chore: another justfile fix + cargo update #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: CI | |
| on: | |
| push: | |
| branches: [latest] | |
| pull_request: | |
| branches: [latest] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: backfill_test | |
| POSTGRES_USER: testuser | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly, stable | |
| components: clippy, rustfmt, llvm-tools-preview | |
| cache-directories: | | |
| ~/.cargo/registry | |
| ~/.cargo/bin | |
| target | |
| - name: Install cargo-nextest and cargo-llvm-cov | |
| shell: bash | |
| run: | | |
| if [[ -z $(which cargo-nextest) ]]; then | |
| curl -sL https://get.nexte.st/latest/linux -o nextest.tgz | |
| tar xfz nextest.tgz | |
| mv cargo-nextest /home/runner/.cargo/bin | |
| fi | |
| if [[ -z $(which cargo-llvm-cov) ]]; then | |
| curl -sL https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz -o cargo-llvm-cov.tgz | |
| tar xfz cargo-llvm-cov.tgz | |
| mv cargo-llvm-cov /home/runner/.cargo/bin | |
| fi | |
| - name: Check formatting | |
| run: cargo +nightly fmt --check --all | |
| - name: Run clippy | |
| run: cargo clippy --all-targets -F axum | |
| - name: Run tests | |
| run: cargo nextest run -F axum -- --skip no_ci | |
| env: | |
| DATABASE_URL: postgresql://testuser@localhost:5432/backfill_test | |
| - name: Run doctests | |
| run: cargo test --doc | |
| env: | |
| DATABASE_URL: postgresql://testuser@localhost:5432/backfill_test | |
| # - name: Generate code coverage | |
| # run: | | |
| # # cargo llvm-cov --all-targets -F axum --workspace --lcov --output-path lcov.info | |
| # # Extract coverage percentage and save it | |
| # COVERAGE=$(cargo llvm-cov --all-targets -F axum --workspace --summary-only | grep -E "TOTAL.*[0-9]+\.[0-9]+%" | grep -oE "[0-9]+\.[0-9]+%" | head -1) | |
| # echo "COVERAGE_PERCENTAGE=$COVERAGE" >> $GITHUB_ENV | |
| # echo "Coverage: $COVERAGE" | |
| # env: | |
| # DATABASE_URL: postgresql://testuser@localhost:5432/backfill_test |