-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.22 KB
/
tests.yml
File metadata and controls
52 lines (41 loc) · 1.22 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Run tests
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
unit-tests:
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-compose.yml
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects for test cases
run: git lfs checkout
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build
- name: Run unit and integration tests
run: |
# Start containers
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up -d
# Wait for container to be ready
sleep 5
# Run all tests in parallel
docker compose exec -T test pytest tests/ -vv -n auto
# Run specific test file in parallel
docker compose exec -T test pytest tests/test_main.py -vv -n auto
- name: Cleanup
run: docker compose down