main.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. name: CI
  2. on:
  3. push:
  4. branches: ["master"]
  5. pull_request:
  6. env:
  7. CARGO_NET_GIT_FETCH_WITH_CLI: true
  8. jobs:
  9. Test:
  10. strategy:
  11. matrix:
  12. os: [ubuntu-latest, macos-latest, windows-latest]
  13. rust: [1.51.0, stable, beta, nightly]
  14. exclude:
  15. - os: macos-latest
  16. rust: 1.51.0
  17. - os: windows-latest
  18. rust: 1.51.0
  19. - os: macos-latest
  20. rust: beta
  21. - os: windows-latest
  22. rust: beta
  23. - os: macos-latest
  24. rust: nightly
  25. runs-on: ${{ matrix.os }}
  26. steps:
  27. - uses: actions/checkout@v2
  28. - uses: actions-rs/toolchain@v1
  29. with:
  30. profile: minimal
  31. toolchain: ${{ matrix.rust }}
  32. override: true
  33. - uses: actions-rs/cargo@v1
  34. with:
  35. command: build
  36. args: --all-targets
  37. # Run tests
  38. - name: Run tests
  39. uses: actions-rs/cargo@v1
  40. with:
  41. command: test
  42. # Run tests enabling the serde feature
  43. - name: Run tests with the serde feature
  44. uses: actions-rs/cargo@v1
  45. with:
  46. command: test
  47. args: --features "url/serde"
  48. # The #[debugger_visualizer] attribute is currently gated behind an unstable feature flag.
  49. # In order to test the visualizers for the url crate, they have to be tested on a nightly build.
  50. - name: Run debugger_visualizer tests
  51. if: |
  52. matrix.os == 'windows-latest' &&
  53. matrix.rust == 'nightly'
  54. uses: actions-rs/cargo@v1
  55. with:
  56. command: test
  57. args: --test debugger_visualizer --features "url/serde,url/debugger_visualizer" -- --test-threads=1
  58. WASM:
  59. runs-on: ubuntu-latest
  60. steps:
  61. - uses: actions/checkout@v2
  62. - uses: actions-rs/toolchain@v1
  63. with:
  64. profile: minimal
  65. toolchain: stable
  66. target: wasm32-unknown-unknown
  67. override: true
  68. - uses: actions-rs/cargo@v1
  69. with:
  70. command: build
  71. args: --target wasm32-unknown-unknown
  72. Lint:
  73. runs-on: ubuntu-latest
  74. steps:
  75. - uses: actions/checkout@v2
  76. - uses: actions-rs/toolchain@v1
  77. with:
  78. profile: minimal
  79. toolchain: stable
  80. override: true
  81. components: rustfmt, clippy
  82. - uses: actions-rs/cargo@v1
  83. with:
  84. command: fmt
  85. args: --all -- --check
  86. - uses: actions-rs/cargo@v1
  87. if: always()
  88. with:
  89. command: clippy
  90. args: --workspace --all-targets -- -D warnings
  91. Audit:
  92. runs-on: ubuntu-latest
  93. steps:
  94. - uses: actions/checkout@v1
  95. - uses: EmbarkStudios/cargo-deny-action@v1