Skip to content

Commit 27d505b

Browse files
authored
Merge pull request #9051 from LawnGnome/ci-fuckery
ci: build backend tests in /mnt
2 parents da3cc44 + db68f39 commit 27d505b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,37 @@ jobs:
115115
TEST_DATABASE_URL: postgres://postgres:postgres@localhost/postgres
116116
RUSTFLAGS: "-D warnings -Cinstrument-coverage"
117117
MALLOC_CONF: "background_thread:true,abort_conf:true,abort:true,junk:true"
118+
CARGO_TARGET_DIR: /mnt/target
118119

119120
steps:
120121
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
121122
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
123+
with:
124+
# Ensure that we cache from the right target directory. (See below
125+
# for the details of how and when this gets created.)
126+
workspaces: '. -> ${{ env.CARGO_TARGET_DIR }}'
122127

123128
# Update `pg_dump` to the same version as the running PostgreSQL server
124129
- run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${{ env.POSTGRES_VERSION }} -i -p
125130
- run: sudo systemctl start postgresql.service
126131
- run: sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'"
127132

133+
# Create a working directory on /mnt, which is a larger temporary
134+
# filesystem than /, that we can then point our later commands to.
135+
- run: |
136+
sudo mkdir ${{ env.CARGO_TARGET_DIR }}
137+
sudo chown $(id -u):$(id -g) ${{ env.CARGO_TARGET_DIR }}
138+
128139
- run: cargo build --tests --workspace
129140
- run: cargo test --workspace
130141

131142
- run: curl -sL https://github.com/mozilla/grcov/releases/download/v${{ env.GRCOV_VERSION }}/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xjf -
132143
- run: rustup component add llvm-tools
133-
- run: ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "target/debug/build/**" -o target/coverage.lcov
144+
- run: ./grcov . --binary-path ${{ env.CARGO_TARGET_DIR }}/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "${{ env.CARGO_TARGET_DIR }}/debug/build/**" -o ${{ env.CARGO_TARGET_DIR }}/coverage.lcov
134145

135146
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
136147
with:
137-
files: target/coverage.lcov
148+
files: ${{ env.CARGO_TARGET_DIR }}/coverage.lcov
138149
env:
139150
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
140151

0 commit comments

Comments
 (0)