Skip to content
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
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: tests

# Run the unit suite inside the actual container image, not against a bare Python
# on the runner — the image is the artifact we ship, so it's the thing we test.
# tests/ is excluded from the image by .dockerignore, so we mount it read-only
# into the built image and run unittest from /app (where the modules live).

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
container-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build the Layover image
run: docker build -t layover:ci .

- name: Run unit tests inside the container
# Override the image ENTRYPOINT (scheduler.py — a forever loop) so the
# container runs the tests and exits instead of starting the scheduler.
run: >
docker run --rm
--entrypoint python3
-e PYTHONDONTWRITEBYTECODE=1
-v "${{ github.workspace }}/tests:/app/tests:ro"
-w /app
layover:ci
-m unittest discover -s tests -v
Loading