-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (70 loc) · 2.14 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
# TODO:
# - https://docs.docker.com/build/cache/backends/inline/
# - https://stackoverflow.com/a/73750495
name: Ci
permissions:
contents: read
checks: write
on:
push:
branches:
- 'master'
env:
IMAGE_NAME: 'omlish-ci'
jobs:
test:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/[email protected]'
- uses: 'styfle/[email protected]'
with:
access_token: '${{ github.token }}'
##
# - name: 'Cache'
# uses: 'actions/cache@v2'
# id: 'cache'
# with:
# path: '~/.cache'
# key:
# ci-${{ github.ref }}-${{ hashFiles(
# 'docker/.timestamp',
# 'docker/ci/Dockerfile',
# 'docker/compose.yml'
# ) }}
# restore-keys: |
# ci-${{ github.ref }}-
# ci-
# - name: 'Docker cache load'
# run: >
# tar -tvf ~/.cache/docker/ci.tar ||: ;
# docker load -i ~/.cache/docker/ci.tar ||: ;
##
# - uses: 'mxschmitt/[email protected]'
- name: 'Build CI image'
run: >
make ci-image
- name: 'Run CI tests'
run: >
CI_DOCKER_OPTS='-v ${{ github.workspace }}:/github/workspace -e PYTEST_JUNIT_XML_PATH'
PYTEST_JUNIT_XML_PATH=/github/workspace/test-results.xml
make ci
- uses: 'mikepenz/[email protected]'
if: 'always()'
with:
report_paths: ${{ github.workspace }}/test-results.xml
##
# - name: 'Docker cache save'
# if: "steps.cache.outputs.cache-hit != 'true'"
# run: >
# docker images -a &&
# mkdir -p ~/.cache/docker/ &&
# (
# for IMG in $(
# egrep '^\s*image:' docker/compose.yml | cut -d"'" -f2 | egrep -v 'wrmsr/omlish-ci'
# ) ; do
# if ( docker history "$IMG" >/dev/null 2>/dev/null ) ; then
# echo "$IMG" ;
# docker history "$IMG" | tail -n+2 | awk '{print $1}' | egrep -v '<missing>' ;
# fi ;
# done
# ) | xargs docker save -o ~/.cache/docker/ci.tar