@@ -115,14 +115,15 @@ jobs:
115
115
TEST_DATABASE_URL : postgres://postgres:postgres@localhost/postgres
116
116
RUSTFLAGS : " -D warnings -Cinstrument-coverage"
117
117
MALLOC_CONF : " background_thread:true,abort_conf:true,abort:true,junk:true"
118
+ CARGO_TARGET_DIR : /mnt/target
118
119
119
120
steps :
120
121
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
121
122
- uses : Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
122
123
with :
123
124
# Ensure that we cache from the right target directory. (See below
124
125
# for the details of how and when this gets created.)
125
- workspaces : ' . -> /mnt/target '
126
+ workspaces : ' . -> ${{ env.CARGO_TARGET_DIR }} '
126
127
127
128
# Update `pg_dump` to the same version as the running PostgreSQL server
128
129
- run : sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${{ env.POSTGRES_VERSION }} -i -p
@@ -132,19 +133,19 @@ jobs:
132
133
# Create a working directory on /mnt, which is a larger temporary
133
134
# filesystem than /, that we can then point our later commands to.
134
135
- run : |
135
- sudo mkdir /mnt/target
136
- sudo chown $(id -u):$(id -g) /mnt/target
136
+ sudo mkdir ${{ env.CARGO_TARGET_DIR }}
137
+ sudo chown $(id -u):$(id -g) ${{ env.CARGO_TARGET_DIR }}
137
138
138
- - run : cargo build --tests --workspace --target-dir=/mnt/target
139
- - run : cargo test --workspace --target-dir=/mnt/target
139
+ - run : cargo build --tests --workspace
140
+ - run : cargo test --workspace
140
141
141
142
- run : curl -sL https://github.com/mozilla/grcov/releases/download/v${{ env.GRCOV_VERSION }}/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xjf -
142
143
- run : rustup component add llvm-tools
143
- - run : ./grcov . --binary-path /mnt/target/ debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "/mnt/target/ debug/build/**" -o /mnt/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
144
145
145
146
- uses : codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
146
147
with :
147
- files : /mnt/target /coverage.lcov
148
+ files : ${{ env.CARGO_TARGET_DIR }} /coverage.lcov
148
149
env :
149
150
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
150
151
0 commit comments