rust.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Rust
  2. on:
  3. push:
  4. branches: [ "main" ]
  5. pull_request:
  6. branches: [ "main" ]
  7. env:
  8. CARGO_TERM_COLOR: always
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Build
  15. run: cargo build --release
  16. - name: Run tests
  17. run: cargo test --release
  18. fmt:
  19. runs-on: ubuntu-latest
  20. steps:
  21. - uses: actions/checkout@v3
  22. - name: Check formatting
  23. run: cargo fmt --check
  24. test:
  25. runs-on: ubuntu-latest
  26. env:
  27. CARGO_TERM_COLOR: always
  28. steps:
  29. - uses: actions/checkout@v4
  30. - name: Install Rust
  31. run: rustup update stable
  32. - name: Install cargo-llvm-cov
  33. uses: taiki-e/install-action@cargo-llvm-cov
  34. - name: Generate code coverage
  35. run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
  36. - name: Upload coverage to Codecov
  37. uses: codecov/[email protected]
  38. with:
  39. token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
  40. files: lcov.info
  41. fail_ci_if_error: false