-
Notifications
You must be signed in to change notification settings - Fork 16
81 lines (76 loc) · 2.5 KB
/
tests.yml
File metadata and controls
81 lines (76 loc) · 2.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Tests
on:
push:
branches:
- master
tags:
- "v*"
pull_request:
branches:
- master
jobs:
unit:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Allow writing from inside the container
run: |
chmod g+w,o+w .
- name: Install Django
run: |
python3 -m pip install --upgrade pip
python3 -m pip install django>4.2
- name: Create env files for testing
run: |
python3 docker/manage-secrets.py
- name: Build images
run: |
docker compose build
- name: Start Compose Stack
run: |
docker compose -f compose.yaml -f compose.override.yml up -d
- name: Run Tests
run: |
docker compose exec -it orthos2 bash -c 'coverage run --source="." manage.py test orthos2'
docker compose exec -it orthos2 bash -c 'coverage report'
docker compose exec -it orthos2 bash -c 'coverage xml'
- name: Upload coverage
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Django
run: |
python3 -m pip install --upgrade pip
python3 -m pip install django>4.2
- name: Create env files for testing
run: |
python3 docker/manage-secrets.py
- name: Build Orthos 2 development docker images
run: |
docker compose build
- name: Setup Orthos 2 server
run: |
docker compose -f compose.yaml -f compose.override.yml up -d
- name: Generate Django Token
run: |
docker compose cp orthos2:/var/lib/orthos2/admin-token .
echo "ORTHOS_DJANGO_ADMIN_TOKEN=$(cat ./admin-token)" >> $GITHUB_ENV
- name: Configure orthosrc
run: |
sed -i "s/token = /token = $ORTHOS_DJANGO_ADMIN_TOKEN/g" cli/orthosrc
sed -i "s/protocol = https/protocol = http/g" cli/orthosrc
sed -i "s/server = orthos2.arch.suse.de/server = localhost/g" cli/orthosrc
sed -i "s/port = 443/port = 8000/g" cli/orthosrc
- run: cat cli/orthosrc
- name: Execute Integration Tests
run: |
docker compose exec -it orthos2 bash -c 'cd cli; python3 -m unittest discover -v'