windows.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: windows
  2. on:
  3. push:
  4. paths:
  5. - packages/**
  6. - examples/**
  7. - src/**
  8. - .github/**
  9. - lib.rs
  10. - Cargo.toml
  11. pull_request:
  12. types: [opened, synchronize, reopened, ready_for_review]
  13. branches:
  14. - master
  15. jobs:
  16. JOB:
  17. if: github.event.pull_request.draft == false
  18. test:
  19. runs-on: windows-latest
  20. name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
  21. env:
  22. CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
  23. strategy:
  24. # https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
  25. # There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
  26. # In order to prevent overusing too much of that 60 limit, we throttle the
  27. # number of rustfmt jobs that will run concurrently.
  28. max-parallel: 2
  29. fail-fast: false
  30. matrix:
  31. target: [x86_64-pc-windows-gnu, x86_64-pc-windows-msvc]
  32. cfg_release_channel: [stable]
  33. steps:
  34. # The Windows runners have autocrlf enabled by default
  35. # which causes failures for some of rustfmt's line-ending sensitive tests
  36. - name: disable git eol translation
  37. run: git config --global core.autocrlf false
  38. - name: checkout
  39. uses: actions/checkout@v2
  40. # Run build
  41. - name: Install Rustup using win.rustup.rs
  42. run: |
  43. # Disable the download progress bar which can cause perf issues
  44. $ProgressPreference = "SilentlyContinue"
  45. Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
  46. .\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
  47. del rustup-init.exe
  48. rustup target add ${{ matrix.target }}
  49. shell: powershell
  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: test
  55. run: |
  56. rustc -Vv
  57. cargo -V
  58. set RUST_BACKTRACE=1
  59. cargo build --features "desktop, ssr, router"
  60. cargo test --features "desktop, ssr, router"
  61. shell: cmd