-
Notifications
You must be signed in to change notification settings - Fork 455
102 lines (89 loc) · 3.08 KB
/
crio.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
name: critest CRI-O
on:
push:
tags:
- "*"
branches:
- master
pull_request:
jobs:
#
# Run CRI tests against CRI-O
#
linux-build-and-critest-cri-o:
strategy:
matrix:
version: [main]
name: ${{matrix.version}} / linux amd64
runs-on: ubuntu-22.04
steps:
- name: Install go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Cache go modules and build cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
'%LocalAppData%\go-build' # Windows
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Setup system
run: |
# enable necessary kernel modules
sudo ip6tables --list >/dev/null
# enable necessary sysctls
sudo sysctl -w net.ipv4.conf.all.route_localnet=1
sudo sysctl -w net.bridge.bridge-nf-call-iptables=1
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -I POSTROUTING -s 127.0.0.0/8 ! -d 127.0.0.0/8 -j MASQUERADE
# enable criu support
sudo apt-get update
sudo apt-get install -y criu
- name: Install ginkgo
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@latest
ginkgo version
sudo cp $(command -v ginkgo) /usr/local/bin
- name: Setup GCloud
uses: google-github-actions/setup-gcloud@v2
- name: Install CRI-O latest main
if: ${{matrix.version == 'main'}}
run: |
curl https://raw.githubusercontent.com/cri-o/packaging/main/get | sudo bash
- name: Configure and start CRI-O
run: |
sudo mkdir -p /etc/crio/crio.conf.d
printf '[crio.runtime]\nlog_level = "debug"\n' | sudo tee /etc/crio/crio.conf.d/01-log-level.conf
printf '[crio.runtime]\nseccomp_use_default_when_empty = false\n' | sudo tee /etc/crio/crio.conf.d/02-seccomp.conf
sudo systemctl daemon-reload
sudo systemctl start crio
- name: Checkout cri-tools for this commit
uses: actions/checkout@v4
with:
path: ${{github.workspace}}/src/github.com/kubernetes-sigs/cri-tools
- name: Build cri-tools
run: |
make
sudo -E PATH=$PATH make install
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools
- name: Run critest
run: |
sudo -E PATH=$PATH critest \
--runtime-endpoint=unix:///var/run/crio/crio.sock \
--ginkgo.flakeAttempts=3 \
--parallel=$(nproc)
sudo journalctl -u crio > cri-o.log
- name: Upload CRI-O logs
uses: actions/upload-artifact@v4
with:
name: cri-o-${{matrix.version}}-${{github.sha}}.log
path: cri-o.log