-
Notifications
You must be signed in to change notification settings - Fork 1.9k
72 lines (60 loc) · 2.05 KB
/
rest-framework-tests.yml
File metadata and controls
72 lines (60 loc) · 2.05 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Rest Framework Unit Tests
on:
workflow_call:
inputs:
platform:
type: string
default: "linux/amd64"
auditlog_type:
type: string
default: "django-auditlog"
jobs:
unit_tests:
name: Rest Framework Unit Tests
runs-on: ${{ inputs.platform == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
env:
AUDITLOG_TYPE: ${{ inputs.auditlog_type }}
strategy:
matrix:
os: [alpine, debian]
steps:
# Replace slashes so we can use this in filenames
- name: Set-platform
run: |
platform=${{ inputs.platform }}
echo "PLATFORM=${platform//\//-}" >> $GITHUB_ENV
echo $GITHUB_ENV
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
# load docker images from build jobs
- name: Load images from artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
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/django-${{ matrix.os }}-${{ env.PLATFORM }}_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 --no-deps -d postgres webhook.endpoint
# no celery or initializer needed for unit tests
- name: Unit tests
timeout-minutes: 15
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