windows.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. [
  23. i686-pc-windows-gnu,
  24. i686-pc-windows-msvc,
  25. x86_64-pc-windows-gnu,
  26. x86_64-pc-windows-msvc,
  27. ]
  28. cfg_release_channel: [nightly, stable]
  29. steps:
  30. # The Windows runners have autocrlf enabled by default
  31. # which causes failures for some of rustfmt's line-ending sensitive tests
  32. - name: disable git eol translation
  33. run: git config --global core.autocrlf false
  34. - name: checkout
  35. uses: actions/checkout@v2
  36. # Run build
  37. - name: Install Rustup using win.rustup.rs
  38. run: |
  39. # Disable the download progress bar which can cause perf issues
  40. $ProgressPreference = "SilentlyContinue"
  41. Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
  42. .\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
  43. del rustup-init.exe
  44. rustup target add ${{ matrix.target }}
  45. shell: powershell
  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. - name: Add mingw64 to path for x86_64-gnu
  52. run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
  53. if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
  54. shell: bash
  55. - name: test
  56. run: |
  57. rustc -Vv
  58. cargo -V
  59. set RUST_BACKTRACE=1
  60. cargo build --features "desktop, ssr, router"
  61. cargo test --features "desktop, ssr, router"
  62. shell: cmd