Skip to content

CI: Build backend tests in /mnt #9051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,37 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
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 }}'

# Update `pg_dump` to the same version as the running PostgreSQL server
- run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${{ env.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 ${{ env.CARGO_TARGET_DIR }}
sudo chown $(id -u):$(id -g) ${{ env.CARGO_TARGET_DIR }}

- run: cargo build --tests --workspace
- run: cargo test --workspace

- run: curl -sL https://github.com/mozilla/grcov/releases/download/v${{ env.GRCOV_VERSION }}/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xjf -
- run: rustup component add llvm-tools
- run: ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "target/debug/build/**" -o target/coverage.lcov
- 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

- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: target/coverage.lcov
files: ${{ env.CARGO_TARGET_DIR }}/coverage.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
Loading