windows.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: windows
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. jobs:
  8. test:
  9. runs-on: windows-latest
  10. name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
  11. env:
  12. CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
  13. strategy:
  14. # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
  15. # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
  16. # In order to prevent overusing too much of that 60 limit, we throttle the
  17. # number of rustfmt jobs that will run concurrently.
  18. max-parallel: 2
  19. fail-fast: false
  20. matrix:
  21. target: [
  22. i686-pc-windows-gnu,
  23. i686-pc-windows-msvc,
  24. x86_64-pc-windows-gnu,
  25. x86_64-pc-windows-msvc,
  26. ]
  27. cfg_release_channel: [nightly, stable]
  28. steps:
  29. # The Windows runners have autocrlf enabled by default
  30. # which causes failures for some of rustfmt's line-ending sensitive tests
  31. - name: disable git eol translation
  32. run: git config --global core.autocrlf false
  33. - name: checkout
  34. uses: actions/checkout@v2
  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. - name: Add mingw32 to path for i686-gnu
  46. run: |
  47. echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
  48. if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
  49. shell: bash
  50. - name: Add mingw64 to path for x86_64-gnu
  51. run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
  52. if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
  53. shell: bash
  54. - name: build
  55. run: |
  56. rustc -Vv
  57. cargo -V
  58. set RUST_BACKTRACE=1
  59. cargo build
  60. shell: cmd
  61. - name: test
  62. run: cargo test
  63. shell: cmd