windows.yml 2.3 KB

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