-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 1.67 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
name: Ci
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
jobs:
test:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- 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(
'.versions',
'docker/.dockertimestamp',
'docker/ci/Dockerfile',
'docker/docker-compose-ext.yml',
'go.mod',
'go.sum'
) }}
restore-keys: |
ci-${{ github.ref }}-
ci-
- name: 'Docker cache load'
run: >
tar -tvf ~/.cache/docker/ci.tar ||: ;
docker load -i ~/.cache/docker/ci.tar ||: ;
docker image history wrmsr/bane-ci ||: ;
- name: 'Run tests'
run: >
BANE_CI_DOCKER_OPTS='-v ${{ github.workspace }}:/github/workspace'
BANE_CI_OUTPUT_DIR=/github/workspace
make ci
- name: 'Docker cache save'
if: "steps.cache.outputs.cache-hit != 'true'"
run: >
mkdir -p ~/.cache/docker/ &&
docker image history wrmsr/bane-ci &&
(
for IMG in $(
echo wrmsr/bane-ci ;
egrep '^\s*image:' docker/docker-compose-ext.yml | cut -d"'" -f2
) ; do
echo "$IMG" ;
docker history "$IMG" | tail -n+2 | awk '{print $1}' | egrep -v '<missing>' ;
done
) | xargs docker save -o ~/.cache/docker/ci.tar