windows.yml 2.2 KB

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