-
Notifications
You must be signed in to change notification settings - Fork 10
74 lines (72 loc) · 2.25 KB
/
sipa-ci.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
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
name: SIPA CI
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: pre-commit/[email protected]
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Fix permissions
run: sudo chmod -R a+rw .
- name: Build the Docker image
run: docker build -t sipa:latest .
- name: Login to GitLab Registry
uses: docker/login-action@v1
with:
registry: registry.agdsn.de
username: "github-actions"
password: ${{ secrets.GITLAB_REGISTRY_PASSWORD }}
- name: Tag built image
run: docker tag sipa:latest registry.agdsn.de/agdsn/coreos/sipa/sipa:${GITHUB_REF##*/}
- name: Push to GitLab registry
run: docker push registry.agdsn.de/agdsn/coreos/sipa/sipa:${GITHUB_REF##*/}
test:
runs-on: ubuntu-latest
steps:
- name: Check out sipa and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- name: print information about pip cache
run: pip cache info && pip cache list
- name: ensure presence of `wheel`
run: pip install wheel
- name: install pip dependencies
run: >
pip install
-r build/requirements/requirements.txt
-r build/requirements/requirements_testing.txt
id: pip-install
# now come the tests
- name: Run tests
run: >
pytest
--junitxml=junit/test-results.xml
--cov --cov-report=xml:cov/cov-results.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'junit/test-*.xml'
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: ./cov/cov-results.xml
use_oidc: true
verbose: true