Skip to content

Integration test CI

Integration test CI #9

Workflow file for this run

name: Unit and Integration Tests
on:
push: {}
pull_request:
branches: [main]
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# We could choose to set up dependencies manually in the GHA runner instead of installing them during the GHA.
#
# However, I think it's better to do them in the GHA itself so that we're testing our dependency installation step
# in addition to our actual code. It also removes the need to manually reinstall dependencies on the GHA runners
# every time we add a new dependency.
#
# Note that the GHA runners are stateful. Dependencies installed from previous runs will still be on the runner.
# This means this step will usually be pretty fast as most dependencies will already be cached. However, it also
# means that past runs might interfere with the current run, so you sometimes may need to restart the GHA runners.
# We need to do `. "$HOME/.cargo/env"` in each step for it to work.
#
# We need to switch to a non-root user to run Postgres.
- name: Install dependencies
run: |
su - runner
./dependencies/install_dependencies.sh
exit
- name: Run unit tests
run: |
. "$HOME/.cargo/env"
python scripts/run_unit_tests.py
exit
- name: Run integration test
# Delete the workspace. Run once with a clean workspace. Run again from the existing workspace.
run: |
su - runner
. "$HOME/.cargo/env"
rm -rf ../dbgym_integtest_workspace
./scripts/integration_test.sh ssd
./scripts/integration_test.sh ssd
exit