-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1.02 KB
/
Copy pathtests.yml
File metadata and controls
33 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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