rust/.github/workflows/windows.yml

103 lines
3.7 KiB
YAML
Raw Normal View History

2020-09-23 22:22:37 -05:00
name: windows
on:
push:
branches:
- master
pull_request:
2020-09-23 22:22:37 -05:00
jobs:
test:
runs-on: windows-latest
name: (${{ matrix.target }}, ${{ matrix.channel }})
strategy:
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
# In order to prevent overusing too much of that 60 limit, we throttle the
# number of rustfmt jobs that will run concurrently.
max-parallel: 1
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 ]
include:
- channel: nightly
target: i686-pc-windows-gnu
mingw-7z-path: mingw
env:
CFG_RELEASE_CHANNEL: nightly
CFG_RELEASE: 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
#
# Use GitHub Actions cache support to avoid downloading the .7z file every time
# to be cognizant of the AWS egress cost impacts
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
- name: cache mingw.7z
id: cache-mingw
with:
path: ${{ matrix.mingw-7z-path }}
key: ${{ matrix.channel }}-${{ matrix.target }}-mingw
uses: actions/cache@v1
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
- name: download mingw.7z
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
md -Force ${{ matrix.mingw-7z-path }}
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile ${{ matrix.mingw-7z-path }}/mingw.7z
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly' && steps.cache-mingw.outputs.cache-hit != 'true'
shell: powershell
- name: install mingw32
run: |
7z x -y ${{ matrix.mingw-7z-path }}/mingw.7z -oC:\msys64 | Out-Null
echo ::add-path::C:\msys64\mingw32\bin
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
shell: powershell
# Run build
- name: setup
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}-${{ matrix.target }}
target: ${{ matrix.target }}
override: true
profile: minimal
default: true
- name: cargo-make
run: cargo install --force cargo-make
- name: build
run: |
rustc -Vv
cargo -V
cargo build
shell: cmd
- name: test
run: cargo test
shell: cmd