Skip to content

Static type checking #32

Static type checking

Static type checking #32

Workflow file for this run

name: Unit and Integration Tests
on:
push: {}
pull_request:
branches: [main]
jobs:
ci:
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.
- name: Install dependencies
run: |
./dependencies/install_dependencies.sh
- name: Check formatting
run: |
./scripts/check_format.sh
- name: Static type checking
run: |
mypy --config-file scripts/mypy.ini .
- name: Run unit tests
run: |
. "$HOME/.cargo/env"
python scripts/run_unit_tests.py
- name: Run integration tests
# Delete the workspace. Run once with a clean workspace. Run again from the existing workspace.
# Need to run with a non-root user in order to start Postgres.
run: |
. "$HOME/.cargo/env"
rm -rf ../dbgym_integtest_workspace
./scripts/integration_test.sh ssd
./scripts/integration_test.sh ssd