diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21363997c66..33228d2d137 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,8 @@ jobs: - run: rustup component add clippy - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo fmt --check --all - run: cargo clippy --all-targets --all-features --workspace @@ -133,6 +135,8 @@ jobs: persist-credentials: false - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo install cargo-deny --vers ${CARGO_DENY_VERSION} - run: cargo deny check @@ -151,30 +155,24 @@ jobs: TEST_DATABASE_URL: postgres://postgres:postgres@localhost/postgres RUSTFLAGS: "-D warnings -Cinstrument-coverage" MALLOC_CONF: "background_thread:true,abort_conf:true,abort:true,junk:true" - CARGO_TARGET_DIR: /mnt/target steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + # Remove the Android SDK to free up space + - run: sudo rm -rf /usr/local/lib/android + - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 with: - # Ensure that we cache from the right target directory. (See below - # for the details of how and when this gets created.) - workspaces: '. -> ${{ env.CARGO_TARGET_DIR }}' + save-if: ${{ github.ref == 'refs/heads/main' }} # Update `pg_dump` to the same version as the running PostgreSQL server - run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${POSTGRES_VERSION} -i -p - run: sudo systemctl start postgresql.service - run: sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'" - # Create a working directory on /mnt, which is a larger temporary - # filesystem than /, that we can then point our later commands to. - - run: | - sudo mkdir ${CARGO_TARGET_DIR} - sudo chown $(id -u):$(id -g) ${CARGO_TARGET_DIR} - - run: cargo build --tests --workspace - run: cargo test --workspace