-
Notifications
You must be signed in to change notification settings - Fork 17
83 lines (73 loc) · 2.39 KB
/
rebuild.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
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
82
83
name: Rebuild
on:
schedule:
- cron: 30 2 * * *
jobs:
rebuild:
name: Rebuild
runs-on: ubuntu-22.04
timeout-minutes: 50
strategy:
fail-fast: false
matrix:
branch:
- test
steps:
- run: docker system prune --all --force
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt
- name: Checks
run: c2cciutils-checks
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- run: make build
- run: make build-tests
- name: Init Docker volumes
run: |
docker run --rm --detach --name volumes --volume=tests:/tests --volume=results:/results alpine tail -f /dev/null
docker cp tests/ volumes:/tests/
- name: pytest
run: >
docker run --rm --env=PYTHONPATH=/opt/
--volume=results:/results --volume=tests:/tests
sbrunner/scan-to-paperless-tests bash -c '
cd /tests &&
pytest --durations=0 --verbose --color=yes
--profile --profile-svg --junitxml=/results/test-reports/junit.xml .'
- name: Extract data from Docker volumes
run: |
docker cp volumes:/results/ ./
mkdir -p results/
docker cp volumes:/tests/prof/ results/
- uses: actions/upload-artifact@v4
with:
name: results
path: results
if-no-files-found: ignore
retention-days: 5
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Test report
path: results/test-reports
if-no-files-found: ignore
retention-days: 5
if: failure()
- run: docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
- name: Publish
run: c2cciutils-publish --group=docker --type=rebuild --branch=${{ matrix.branch }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- run: make build-all
- name: Publish Docker all
run: |
c2cciutils-publish --group=docker-all
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
if: env.HAS_SECRETS == 'HAS_SECRETS'