Skip to content

setup windows builds on GitHub Actions #3969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/windows.yml
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