forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.5 KB
/
rest-framework-tests.yml
File metadata and controls
57 lines (46 loc) · 1.5 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
53
54
55
56
57
name: Rest Framework Unit Tests
on:
workflow_call:
jobs:
unit_tests:
name: Rest Framework Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [alpine, debian]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
# load docker images from build jobs
- name: Load images from artifacts
uses: actions/download-artifact@v4
with:
path: built-docker-image
pattern: built-docker-image-*
merge-multiple: true
- name: Load docker images
timeout-minutes: 10
run: |-
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
docker load -i built-docker-image/django-${{ matrix.os }}_img
docker images
# run tests with docker compose
- name: Set unit-test mode
run: docker/setEnv.sh unit_tests_cicd
# phased startup so we can use the exit code from unit test container
- name: Start Postgres and webhook.endpoint
run: docker compose up -d postgres webhook.endpoint
# no celery or initializer needed for unit tests
- name: Unit tests
timeout-minutes: 10
run: docker compose up --no-deps --exit-code-from uwsgi uwsgi
env:
DJANGO_VERSION: ${{ matrix.os }}
- name: Logs
if: failure()
run: docker compose logs --tail="2500" uwsgi
- name: Shutdown
if: always()
run: docker compose down