-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.03 KB
/
ci.yaml
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
name: Backend Checks
on:
pull_request:
types: [opened, synchronize, labeled]
jobs:
build:
name: merge checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Fail workflow until run
if: ${{ !contains(github.event.pull_request.labels.*.name, 'run-tests') }}
run: |
echo "Cannot merge until tests run"
exit 1
- name: Build
run: |
docker-compose -f docker-compose-dev-ga.yaml up --build -d
- name: Run Tests
run: |
docker-compose -f docker-compose-dev-ga.yaml exec -T backend pip3 install pytest
docker-compose -f docker-compose-dev.yaml exec -T backend python3 -m pytest
- name: Print logs
if: always()
run: |
docker ps -a
df -h
docker logs commonplace-public_db_1
docker logs commonplace-public_backend_1
- name: Cleanup
if: always()
run: docker-compose -f docker-compose-dev-ga.yaml down