-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: try windows build on GitHub Actions (#3969)
- Loading branch information
1 parent
83f44e2
commit 1e04b5e
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: windows | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [ | ||
i686-pc-windows-gnu, | ||
i686-pc-windows-msvc, | ||
x86_64-pc-windows-gnu, | ||
x86_64-pc-windows-msvc, | ||
] | ||
channel: [ nightly ] | ||
|
||
steps: | ||
# The Windows runners have autocrlf enabled by default | ||
# which causes failures for some of rustfmt's line-ending sensitive tests | ||
- name: disable git eol translation | ||
run: git config --global core.autocrlf false | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
# The Windows runners do not (yet) have a proper msys/mingw environment | ||
# pre-configured like AppVeyor does, though they will likely be added in the future. | ||
# /~https://github.com/actions/virtual-environments/issues/30 | ||
# | ||
# In the interim, this ensures mingw32 is installed and available on the PATH | ||
# for the i686-pc-windows-gnu target. This approach is used because it's common in | ||
# other rust projects and there are issues/limitations with the msys2 chocolatey nuget | ||
# package and numworks/setup-msys2 action. | ||
# /~https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh#L59 | ||
# /~https://github.com/rust-lang/rustup/blob/master/appveyor.yml | ||
- name: install mingw32 | ||
run: | | ||
# Disable the download progress bar which can cause perf issues | ||
$ProgressPreference = "SilentlyContinue" | ||
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile mingw.7z | ||
7z x -y mingw.7z -oC:\msys64 | Out-Null | ||
del mingw.7z | ||
echo ::add-path::C:\msys64\mingw32\bin | ||
if: matrix.target == 'i686-pc-windows-gnu' | ||
shell: powershell | ||
- name: setup | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.channel }}-${{ matrix.target }} | ||
target: ${{ matrix.target }} | ||
override: true | ||
profile: minimal | ||
default: true | ||
- name: build | ||
run: | | ||
rustc -Vv | ||
cargo -V | ||
cargo build | ||
shell: cmd | ||
- name: test | ||
run: cargo test | ||
shell: cmd | ||
- name: 'test ignored' | ||
run: cargo test -- --ignored | ||
shell: cmd |