main.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.56.0, stable, beta, nightly]
  14. exclude:
  15. - os: macos-latest
  16. rust: 1.56.0
  17. - os: windows-latest
  18. rust: 1.56.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/debugger_visualizer,url_debug_tests/debugger_visualizer" -- --test-threads=1
  45. - name: Test `no_std` support
  46. run: cargo test --no-default-features --features=alloc
  47. WASM:
  48. runs-on: ubuntu-latest
  49. steps:
  50. - uses: actions/checkout@v3
  51. - uses: dtolnay/rust-toolchain@stable
  52. with:
  53. targets: wasm32-unknown-unknown
  54. - run: cargo build --target wasm32-unknown-unknown
  55. Lint:
  56. runs-on: ubuntu-latest
  57. steps:
  58. - uses: actions/checkout@v3
  59. - uses: dtolnay/rust-toolchain@stable
  60. with:
  61. components: rustfmt, clippy
  62. - run: cargo fmt --all --check
  63. - run: cargo clippy --workspace --all-targets -- -D warnings
  64. if: always()
  65. Audit:
  66. runs-on: ubuntu-latest
  67. steps:
  68. - uses: actions/checkout@v3
  69. - uses: EmbarkStudios/cargo-deny-action@v1