-
Notifications
You must be signed in to change notification settings - Fork 18
128 lines (125 loc) · 4.62 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Aktualizr CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
jobs:
coverage:
name: Build and Test on Debian Bullseye
runs-on: ubuntu-latest
env:
DOCKER_TAG: docker.pkg.github.com/uptane/aktualizr/aktualizr-ci:bullseye-master
DOCKERFILE: docker/Dockerfile.debian.bullseye
DARGS: >-
-eCCACHE_DIR
-eTEST_CMAKE_BUILD_TYPE=Valgrind
-eTEST_WITH_P11=1
-eTEST_WITH_FAULT_INJECTION=1
-eTEST_TESTSUITE_EXCLUDE=credentials
-eTEST_SOTA_PACKED_CREDENTIALS=dummy-credentials
steps:
- uses: actions/checkout@main
- run: |
git fetch --prune --unshallow
git submodule update --init --recursive --force
- name: Docker login
if: github.token
run: echo ${{ github.token }} | docker login docker.pkg.github.com -u uptane --password-stdin
- name: Docker build
run: |
docker pull "$DOCKER_TAG" || true
docker build --cache-from "$DOCKER_TAG" --pull -t "$DOCKER_TAG" -f "$DOCKERFILE" .
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/cache
key: debian-bullseye-${{ github.run_id }}
restore-keys: |
debian-bullseye-${{ github.run_id }}
debian-bullseye-
- name: Unpack ccache
run: docker run --mount=type=volume,source=ccache,destination=/home/testuser/.cache -i "$DOCKER_TAG" tar -xf- < ${{github.workspace}}/cache/cache.tar || echo "No cache found"
- name: Test
run: |
docker run --mount=type=volume,source=ccache,destination=/home/testuser/.cache -t "$DOCKER_TAG" source/scripts/build-and-test.sh
- name: Stash ccache
run: |
mkdir -p ${{github.workspace}}/cache
docker run --mount=type=volume,source=ccache,destination=/home/testuser/.cache -i "$DOCKER_TAG" tar -cf- .cache > ${{github.workspace}}/cache/cache.tar
nop11:
name: Tests with PKCS#11 support on Ubuntu Bionic
runs-on: ubuntu-latest
env:
DOCKER_TAG: docker.pkg.github.com/uptane/aktualizr/aktualizr-ci:bionic-master
DOCKERFILE: docker/Dockerfile.ubuntu.bionic
DARGS: >-
-eCCACHE_DIR
-eTEST_CMAKE_BUILD_TYPE=Debug
-eTEST_WITH_P11=1
-eTEST_WITH_TESTSUITE=0
steps:
- uses: actions/checkout@main
- run: |
git fetch --prune --unshallow
git submodule update --init --recursive --force
- name: Docker login
if: github.token
run: echo ${{ github.token }} | docker login docker.pkg.github.com -u uptane --password-stdin
- name: Docker build
run: |
docker pull "$DOCKER_TAG" || true
docker build --cache-from "$DOCKER_TAG" --pull -t "$DOCKER_TAG" -f "$DOCKERFILE" .
- uses: actions/cache@v1.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ubuntu-bionic-${{ github.run_id }}
restore-keys: |
ubuntu-bionic-${{ github.run_id }}
ubuntu-bionic-
- name: Test
run: docker run -v "$PWD:$PWD" -w "$PWD" $DARGS -t "$DOCKER_TAG" ./scripts/test.sh
static-checks:
name: Static checks on Ubuntu Focal
runs-on: ubuntu-latest
env:
DOCKER_TAG: docker.pkg.github.com/uptane/aktualizr/aktualizr-ci:ubuntu-focal-master
DOCKERFILE: docker/Dockerfile.ubuntu.focal
DARGS: >-
-eCCACHE_DIR
-eTEST_CC=clang
-eTEST_CMAKE_BUILD_TYPE=Valgrind
-eTEST_TESTSUITE_ONLY=crypto
-eTEST_WITH_STATICTESTS=1
-eTEST_WITH_DOCS=1
steps:
- uses: actions/checkout@main
- run: |
git fetch --prune --unshallow
git submodule update --init --recursive --force
- name: Docker login
if: github.token
run: echo ${{ github.token }} | docker login docker.pkg.github.com -u uptane --password-stdin
- name: Docker build
run: |
docker pull "$DOCKER_TAG" || true
docker build --cache-from "$DOCKER_TAG" --pull -t "$DOCKER_TAG" -f "$DOCKERFILE" .
- uses: actions/cache@v1.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ubuntu-focal-${{ github.run_id }}
restore-keys: |
ubuntu-focal-${{ github.run_id }}
ubuntu-focal-
- name: Test
run: docker run -v "$PWD:$PWD" -w "$PWD" $DARGS -t "$DOCKER_TAG" ./scripts/test.sh
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore_paths: third_party