-
Notifications
You must be signed in to change notification settings - Fork 44
142 lines (113 loc) · 4.53 KB
/
validations.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
name: "Validations"
on:
workflow_dispatch:
inputs:
run-tmate:
description: "Start a tmate session"
required: false
default: ""
tmate-duration:
description: "Tmate session duration"
required: false
default: 5
push:
branches:
- main
pull_request:
jobs:
Static-Analysis:
name: "Static analysis"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Run static analysis
run: make static-analysis
Unit-Test:
name: "Unit tests"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Run unit tests
run: make unit
- uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: test/results/**/*
Integration-Test:
name: "Integration tests"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
with:
# needed for rootless containerd
bootstrap-apt-packages: "rootlesskit"
- name: Enable systemd for podman socket activation
run: |
set -x
loginctl enable-linger $(whoami)
# we need to make certain that the bus instance is up and ready before systemctl attempts to use it.
# if we can figure a non-racey way to do this, that would be nice.
sleep 5
export XDG_RUNTIME_DIR=/run/user/$UID
mkdir -p $HOME/.config/systemd/user
systemctl --user enable --now podman.socket
sudo systemctl enable --now podman.socket
sudo systemctl start podman.socket
sleep 1
# simple test to make sure the daemon is up and running
podman images ls
sudo podman images ls
- name: Setup containerd
uses: crazy-max/ghaction-setup-containerd@60acbf31e6572da7b83a4ed6b428ed92a35ff4d7 #v3.0.0
- name: Configure rootless containerd
run: |
set -x
mkdir ~/.local/bin
pushd ~/.local/bin
curl -O https://raw.githubusercontent.com/containerd/nerdctl/v1.5.0/extras/rootless/containerd-rootless.sh
curl -O https://raw.githubusercontent.com/containerd/nerdctl/v1.5.0/extras/rootless/containerd-rootless-setuptool.sh
chmod 755 containerd-rootless.sh containerd-rootless-setuptool.sh
popd
containerd-rootless-setuptool.sh install
sleep 1
export CONTAINERD_ADDRESS=/proc/$(cat $XDG_RUNTIME_DIR/containerd-rootless/child_pid)/root/run/containerd/containerd.sock
# simple test to make sure the daemon is up and running
ctr image ls
sudo ctr image ls
- name: Setup tmate session
if: ${{ github.event.inputs.run-tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: ${{ fromJSON(github.event.inputs.tmate-duration) }}
with:
limit-access-to-actor: true
- name: Restore integration test-fixture cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
with:
path: ${{ github.workspace }}/test/integration/test-fixtures/cache
key: ${{ runner.os }}-integration-test-cache-${{ hashFiles('test/integration/test-fixtures/cache.fingerprint') }}
- name: Restore integration tool cache
id: integration-tool-cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
with:
path: ${{ github.workspace }}/test/integration/tools/cache
key: ${{ runner.os }}-integration-tools-cache-${{ hashFiles('test/integration/tools/cache.fingerprint') }}
- name: (cache-hit) Load integration tool cache
if: steps.integration-tool-cache.outputs.cache-hit == 'true'
run: make integration-tools-load
- name: Run integration tests
run: make integration
Build-Snapshot-Artifacts:
name: "Build snapshot artifacts"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Build snapshot artifacts
run: make snapshot