main.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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@v3
  28. - uses: dtolnay/rust-toolchain@master
  29. with:
  30. toolchain: ${{ matrix.rust }}
  31. - run: cargo build --all-targets
  32. # Run tests
  33. - name: Run tests
  34. run: cargo test
  35. # Run tests enabling the serde feature
  36. - name: Run tests with the serde feature
  37. run: cargo test --features "url/serde,url/expose_internals"
  38. # The #[debugger_visualizer] attribute is currently gated behind an unstable feature flag.
  39. # In order to test the visualizers for the url crate, they have to be tested on a nightly build.
  40. - name: Run debugger_visualizer tests
  41. if: |
  42. matrix.os == 'windows-latest' &&
  43. matrix.rust == 'nightly'
  44. run: cargo test --test debugger_visualizer --features "url/serde,url/debugger_visualizer" -- --test-threads=1
  45. WASM:
  46. runs-on: ubuntu-latest
  47. steps:
  48. - uses: actions/checkout@v3
  49. - uses: dtolnay/rust-toolchain@stable
  50. with:
  51. targets: wasm32-unknown-unknown
  52. - run: cargo build --target wasm32-unknown-unknown
  53. Lint:
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v3
  57. - uses: dtolnay/rust-toolchain@stable
  58. with:
  59. components: rustfmt, clippy
  60. - run: cargo fmt --all --check
  61. - run: cargo clippy --workspace --all-targets -- -D warnings
  62. if: always()
  63. Audit:
  64. runs-on: ubuntu-latest
  65. steps:
  66. - uses: actions/checkout@v3
  67. - uses: EmbarkStudios/cargo-deny-action@v1