checks.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. name: 🧪 Tests and Checks
  2. on:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ '**' ]
  7. jobs:
  8. rust-checks:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. fail-fast: false
  12. matrix:
  13. rust-toolchain:
  14. - 1.75
  15. - nightly
  16. steps:
  17. - name: Checkout Repository
  18. uses: actions/checkout@v4
  19. # Smarter caching action, speeds up build times compared to regular cache:
  20. # https://github.com/Swatinem/rust-cache
  21. - name: Cache Project
  22. uses: Swatinem/rust-cache@v2
  23. # Widely adopted suite of Rust-specific boilerplate actions, especially
  24. # toolchain/cargo use: https://actions-rs.github.io/
  25. - name: Install Rust Toolchain
  26. uses: actions-rs/toolchain@v1
  27. with:
  28. override: true
  29. components: rustfmt, clippy
  30. toolchain: ${{ matrix.rust-toolchain }}
  31. - name: Check Format
  32. uses: actions-rs/cargo@v1
  33. with:
  34. args: --all -- --check
  35. command: fmt
  36. toolchain: ${{ matrix.rust-toolchain }}
  37. - name: Run Linter
  38. uses: actions-rs/cargo@v1
  39. with:
  40. args: --workspace -- -D warnings
  41. command: clippy
  42. toolchain: ${{ matrix.rust-toolchain }}
  43. # Check for security advisories.
  44. - name: Check Advisories
  45. if: ${{ matrix.rust-toolchain == 'stable' }}
  46. uses: EmbarkStudios/cargo-deny-action@v1
  47. with:
  48. command: check advisories
  49. continue-on-error: true
  50. # Audit licenses, unreleased crates, and unexpected duplicate versions.
  51. - name: Check Bans, Licenses, and Sources
  52. if: ${{ matrix.rust-toolchain == 'stable' }}
  53. uses: EmbarkStudios/cargo-deny-action@v1
  54. with:
  55. command: check bans licenses sources
  56. # Only "test" release build on push event.
  57. - name: Test Release
  58. if: github.event_name == 'push'
  59. run: cargo build --release
  60. rust-tests:
  61. runs-on: ubuntu-latest
  62. strategy:
  63. fail-fast: false
  64. matrix:
  65. rust-toolchain:
  66. - 1.75
  67. - nightly
  68. steps:
  69. - name: Checkout Repository
  70. uses: actions/checkout@v4
  71. - name: Cache Project
  72. uses: Swatinem/rust-cache@v2
  73. - name: Run Tests # 3MB of stack space
  74. run: RUST_MIN_STACK=3000000 cargo test --all-features
  75. wasm-js-tests:
  76. strategy:
  77. fail-fast: false
  78. matrix:
  79. rust-toolchain:
  80. - 1.75
  81. - nightly
  82. runs-on: macos-latest
  83. defaults:
  84. run:
  85. working-directory: ./wnfs-wasm
  86. steps:
  87. - name: Checkout Repository
  88. uses: actions/checkout@v4
  89. - name: Cache Project (JavaScript)
  90. uses: actions/setup-node@v4
  91. with:
  92. node-version: '16.x'
  93. - name: Cache Project (Rust)
  94. uses: Swatinem/rust-cache@v2
  95. - name: Install Wasm Bindgen CLI
  96. uses: "actions-rs/cargo@v1"
  97. with:
  98. args: "--force wasm-bindgen-cli"
  99. command: install
  100. - name: Install Binaryen
  101. run: brew install binaryen
  102. - name: Setup WebAssembly Toolchain
  103. run: rustup target add wasm32-unknown-unknown
  104. - name: Install Node Dependencies
  105. run: yarn
  106. - name: Install Playwright
  107. run: npx playwright install --with-deps
  108. - name: Build
  109. run: yarn run build
  110. - name: Run Playwright Tests
  111. run: yarn run test