@@ -106,6 +106,8 @@ jobs:
106
106
- run : rustup component add clippy
107
107
108
108
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
109
+ with :
110
+ save-if : ${{ github.ref == 'refs/heads/main' }}
109
111
110
112
- run : cargo fmt --check --all
111
113
- run : cargo clippy --all-targets --all-features --workspace
@@ -133,6 +135,8 @@ jobs:
133
135
persist-credentials : false
134
136
135
137
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
138
+ with :
139
+ save-if : ${{ github.ref == 'refs/heads/main' }}
136
140
137
141
- run : cargo install cargo-deny --vers ${CARGO_DENY_VERSION}
138
142
- run : cargo deny check
@@ -151,30 +155,24 @@ jobs:
151
155
TEST_DATABASE_URL : postgres://postgres:postgres@localhost/postgres
152
156
RUSTFLAGS : " -D warnings -Cinstrument-coverage"
153
157
MALLOC_CONF : " background_thread:true,abort_conf:true,abort:true,junk:true"
154
- CARGO_TARGET_DIR : /mnt/target
155
158
156
159
steps :
157
160
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
158
161
with :
159
162
persist-credentials : false
160
163
164
+ # Remove the Android SDK to free up space
165
+ - run : sudo rm -rf /usr/local/lib/android
166
+
161
167
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
162
168
with :
163
- # Ensure that we cache from the right target directory. (See below
164
- # for the details of how and when this gets created.)
165
- workspaces : ' . -> ${{ env.CARGO_TARGET_DIR }}'
169
+ save-if : ${{ github.ref == 'refs/heads/main' }}
166
170
167
171
# Update `pg_dump` to the same version as the running PostgreSQL server
168
172
- run : sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${POSTGRES_VERSION} -i -p
169
173
- run : sudo systemctl start postgresql.service
170
174
- run : sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'"
171
175
172
- # Create a working directory on /mnt, which is a larger temporary
173
- # filesystem than /, that we can then point our later commands to.
174
- - run : |
175
- sudo mkdir ${CARGO_TARGET_DIR}
176
- sudo chown $(id -u):$(id -g) ${CARGO_TARGET_DIR}
177
-
178
176
- run : cargo build --tests --workspace
179
177
- run : cargo test --workspace
180
178
0 commit comments