-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (36 loc) · 1.31 KB
/
tests.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
37
38
name: Tests
on: push
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
pytest-suite:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up docker caching
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ hashFiles('Dockerfile', '**/compose*yaml', '.docker/*', 'pyproject.toml', 'environment.yaml') }}
restore-keys: |
${{ runner.os }}-docker-
- name: Build the stack
run: |
docker buildx build --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache,mode=max --build-arg BUILDKIT_INLINE_CACHE=1 .
docker-compose up -d
env:
DOCKER_BUILDKIT: 1
- name: Wait for services to be ready
run: sleep 10 # Adjust time as needed for your services
- name: Run pytest
run: docker-compose run --entrypoint '/bin/bash -lc' app pytest tests
- name: Tear down the stack
if: always()
run: docker-compose down