Skip to content

Gymlib consolidation #168

Gymlib consolidation

Gymlib consolidation #168

Workflow file for this run

name: Static, Unit, Integration, and End-to-End Tests
on:
pull_request:
branches: [main]
jobs:
tests:
# The code for the self-hosted runners is at https://github.com/wangpatrick57/dbgym-runners.
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: |
pip install -r ./scripts/configs/requirements.txt
pip install ./gymlib_package
./scripts/install_sysdeps.sh
- name: Check formatting
run: |
./scripts/check_format.sh
- name: Static type checking
run: |
./scripts/mypy.sh
- name: Run unit tests
# Unit tests are defined as tests which don't require any external systems to be running.
run: |
. "$HOME/.cargo/env"
./scripts/run_unit_tests.sh
- name: Run integration tests
# Integration tests do require external systems to be running (most commonly a database instance).
# Unlike end-to-end tests though, they test a specific module in a detailed manner, much like a unit test does.
env:
# The CI runs on ssd so we have to set this.
INTENDED_DBDATA_HARDWARE: ssd
run: |
. "$HOME/.cargo/env"
export
./scripts/run_integration_tests.sh