]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/.github/workflows/windows.yml
Rollup merge of #89876 - AlexApps99:const_ops, r=oli-obk
[rust.git] / src / tools / rustfmt / .github / workflows / windows.yml
1 name: windows
2 on:
3   push:
4     branches:
5       - master
6   pull_request:
7
8 jobs:
9   test:
10     runs-on: windows-latest
11     name: (${{ matrix.target }}, nightly)
12     strategy:
13       # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
14       # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
15       # In order to prevent overusing too much of that 60 limit, we throttle the
16       # number of rustfmt jobs that will run concurrently.
17       max-parallel: 2
18       fail-fast: false
19       matrix:
20         target: [
21           i686-pc-windows-gnu,
22           i686-pc-windows-msvc,
23           x86_64-pc-windows-gnu,
24           x86_64-pc-windows-msvc,
25         ]
26
27     steps:
28     # The Windows runners have autocrlf enabled by default
29     # which causes failures for some of rustfmt's line-ending sensitive tests
30     - name: disable git eol translation
31       run: git config --global core.autocrlf false
32     - name: checkout
33       uses: actions/checkout@v2
34
35       # Run build
36     - name: Install Rustup using win.rustup.rs
37       run: |
38         # Disable the download progress bar which can cause perf issues
39         $ProgressPreference = "SilentlyContinue"
40         Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
41         .\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
42         del rustup-init.exe
43         rustup target add ${{ matrix.target }}
44       shell: powershell
45
46     - name: Add mingw32 to path for i686-gnu
47       run: |
48         echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
49       if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
50       shell: bash
51
52     - name: Add mingw64 to path for x86_64-gnu
53       run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
54       if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
55       shell: bash
56
57     - name: build
58       run: |
59         rustc -Vv
60         cargo -V
61         cargo build
62       shell: cmd
63
64     - name: test
65       run: cargo test
66       shell: cmd