Skip to content

Commit 1e04b5e

Browse files
calebcartwrighttopecongiro
authored andcommitted
ci: try windows build on GitHub Actions (#3969)
1 parent 83f44e2 commit 1e04b5e

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/windows.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: windows
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
runs-on: windows-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
target: [
11+
i686-pc-windows-gnu,
12+
i686-pc-windows-msvc,
13+
x86_64-pc-windows-gnu,
14+
x86_64-pc-windows-msvc,
15+
]
16+
channel: [ nightly ]
17+
18+
steps:
19+
# The Windows runners have autocrlf enabled by default
20+
# which causes failures for some of rustfmt's line-ending sensitive tests
21+
- name: disable git eol translation
22+
run: git config --global core.autocrlf false
23+
- name: checkout
24+
uses: actions/checkout@v2
25+
# The Windows runners do not (yet) have a proper msys/mingw environment
26+
# pre-configured like AppVeyor does, though they will likely be added in the future.
27+
# https://github.com/actions/virtual-environments/issues/30
28+
#
29+
# In the interim, this ensures mingw32 is installed and available on the PATH
30+
# for the i686-pc-windows-gnu target. This approach is used because it's common in
31+
# other rust projects and there are issues/limitations with the msys2 chocolatey nuget
32+
# package and numworks/setup-msys2 action.
33+
# https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh#L59
34+
# https://github.com/rust-lang/rustup/blob/master/appveyor.yml
35+
- name: install mingw32
36+
run: |
37+
# Disable the download progress bar which can cause perf issues
38+
$ProgressPreference = "SilentlyContinue"
39+
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile mingw.7z
40+
7z x -y mingw.7z -oC:\msys64 | Out-Null
41+
del mingw.7z
42+
echo ::add-path::C:\msys64\mingw32\bin
43+
if: matrix.target == 'i686-pc-windows-gnu'
44+
shell: powershell
45+
- name: setup
46+
uses: actions-rs/toolchain@v1
47+
with:
48+
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
49+
target: ${{ matrix.target }}
50+
override: true
51+
profile: minimal
52+
default: true
53+
- name: build
54+
run: |
55+
rustc -Vv
56+
cargo -V
57+
cargo build
58+
shell: cmd
59+
- name: test
60+
run: cargo test
61+
shell: cmd
62+
- name: 'test ignored'
63+
run: cargo test -- --ignored
64+
shell: cmd

0 commit comments

Comments
 (0)