name: CI on: push: pull_request: schedule: # Weekly, so new advisories against unchanged dependencies still surface. - cron: "17 6 * * 1" permissions: contents: read # Every action is pinned to a commit, not a tag a compromised upstream could move. To update # one, look up the new release's commit (git ls-remote --tags https://github.com//) # and change the hash and its comment together. env: CARGO_TERM_COLOR: always jobs: check: name: Format, lint and test runs-on: ubuntu-latest # The suite takes seconds; a hang should fail fast rather than run for GitHub's six hours. timeout-minutes: 20 if: github.event_name != 'schedule' steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable branch with: # Pinned to a commit, the action can't read the toolchain from a branch name. toolchain: stable components: rustfmt, clippy - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - run: cargo fmt --all --check - run: cargo clippy --workspace --all-targets --locked -- -D warnings # The integration tests drive real git, rsync, flock and mountpoint, all on the runner. # The whole workspace at once: the web tests use the gitv binary too. - run: cargo test --workspace --locked audit: name: Dependency advisories and licences runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2.90.8 with: # cargo-about is pinned so THIRD-PARTY-LICENSES only changes when dependencies do. tool: cargo-audit,cargo-about@0.9.3 - run: cargo audit - name: THIRD-PARTY-LICENSES is current run: | scripts/third-party-licenses "$RUNNER_TEMP/THIRD-PARTY-LICENSES" diff -u THIRD-PARTY-LICENSES "$RUNNER_TEMP/THIRD-PARTY-LICENSES" || { echo "::error::THIRD-PARTY-LICENSES is out of date: run scripts/third-party-licenses and commit the result" exit 1 }