-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (28 loc) · 896 Bytes
/
test.yml
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
34
35
36
name: Run tests
on:
workflow_dispatch:
pull_request:
push:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test people.json is valid JSON
run: |
python3 -c 'import json; json.load(open("people.json"))'
- name: Test image builds
run: |
docker compose -f compose.yml build
- name: Test container can start and is healthy
run: |
# Launch the project from docker-compose.yml and wait up to
# 30s for its built-in health check to return "healthy"
docker compose -f compose.yml up --wait --wait-timeout 30
docker compose -f compose.yml down
- name: Run Pytest tests
run: |
docker compose -f compose.yml run --entrypoint "" web pytest