Skip to content

Commit 6a86eeb

Browse files
author
Georgios Ntoutsos
committed
ci: Add arm64 tests
Signed-off-by: Georgios Ntoutsos <gntouts@nubificus.co.uk>
1 parent fb8839e commit 6a86eeb

3 files changed

Lines changed: 34 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ jobs:
5454
ref: ${{ inputs.ref }}
5555
secrets: inherit
5656

57-
#FIXME: run for arm64
5857
vm_test:
5958
if: ${{ inputs.skip-build != 'yes' }}
6059
needs: [build,unit_test]
6160
name: E2E test
6261
uses: ./.github/workflows/vm_test.yml
6362
with:
6463
ref: ${{ inputs.ref }}
64+
runner-archs: '["amd64", "arm64"]'
6565
runc_version: '1.3.0'
6666
containerd_version: '2.1.3'
6767
cni_version: '1.7.1'

.github/workflows/ci_on_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: urunc CI
33
on:
44
pull_request:
55
branches: ["main"]
6-
types: [open,synchronize,reopened,labeled]
6+
types: [opened,synchronize,reopened,labeled]
77

88
concurrency:
99
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

.github/workflows/vm_test.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,24 @@ on:
4444
jobs:
4545
prepare:
4646
name: VM test
47-
runs-on: ubuntu-22.04
47+
runs-on: ${{ matrix.runner }}
4848
strategy:
4949
matrix:
50-
arch: ["${{ fromJSON(inputs.runner-archs) }}"]
50+
arch: ${{ fromJSON(inputs.runner-archs) }}
5151
test: ["test_ctr","test_nerdctl","test_crictl","test_docker"]
52-
fail-fast: false
52+
include:
53+
- arch: amd64
54+
runner: ubuntu-22.04
55+
- arch: arm64
56+
runner: ubuntu-22.04-arm
57+
58+
continue-on-error: true
59+
5360
steps:
5461
- uses: actions/checkout@v3
5562
with:
5663
ref: ${{ github.event.pull_request.head.sha }}
57-
- uses: actions/setup-go@v4
64+
- uses: actions/setup-go@v5
5865
with:
5966
go-version: '1.24.1'
6067
cache: false
@@ -126,7 +133,6 @@ jobs:
126133
EOT
127134
sudo systemctl restart containerd
128135
129-
130136
- name: Install CNI plugins
131137
run: |
132138
wget -q https://github.com/containernetworking/plugins/releases/download/v${{ inputs.cni_version }}/cni-plugins-linux-$(dpkg --print-architecture)-v${{ inputs.cni_version }}.tgz
@@ -142,9 +148,9 @@ jobs:
142148
143149
- name: Install crictl
144150
run: |
145-
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/${{ inputs.crictl_version }}/crictl-${{ inputs.crictl_version }}-linux-amd64.tar.gz
146-
sudo tar zxvf crictl-${{ inputs.crictl_version }}-linux-amd64.tar.gz -C /usr/local/bin
147-
rm -f crictl-${{ inputs.crictl_version }}-linux-amd64.tar.gz
151+
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/${{ inputs.crictl_version }}/crictl-${{ inputs.crictl_version }}-linux-${{matrix.arch}}.tar.gz
152+
sudo tar zxvf crictl-${{ inputs.crictl_version }}-linux-${{matrix.arch}}.tar.gz -C /usr/local/bin
153+
rm -f crictl-${{ inputs.crictl_version }}-linux-${{matrix.arch}}.tar.gz
148154
sudo tee -a /etc/crictl.yaml > /dev/null <<'EOT'
149155
runtime-endpoint: unix:///run/containerd/containerd.sock
150156
image-endpoint: unix:///run/containerd/containerd.sock
@@ -190,17 +196,33 @@ jobs:
190196
sudo mv containerd-shim-urunc-v2_static_${{ matrix.arch }} /usr/local/bin/containerd-shim-urunc-v2
191197
urunc --version
192198
199+
- name: Get architecture
200+
id: arch
201+
run: |
202+
ARCH=$(uname -m)
203+
echo "arch=$ARCH" >> $GITHUB_OUTPUT
204+
echo "Architecture: $ARCH"
205+
193206
- name: Add runner user to KVM group
207+
if: ${{ matrix.arch == 'amd64' }}
194208
id: kvm-setup
195209
run: |
196210
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
197211
sudo udevadm control --reload-rules
198212
sudo udevadm trigger --name-match=kvm
199213
sudo usermod -a -G kvm $USER
200214
201-
202215
- name: Run ${{ matrix.test }}
203216
id: test
204217
if: ${{ !cancelled() }}
205218
run: |
206-
sudo make ${{ matrix.test }}
219+
# Set up Go environment properly
220+
export GOROOT=$(go env GOROOT)
221+
export PATH="$GOROOT/bin:$PATH"
222+
go version
223+
go env GOROOT
224+
if [ "${{ matrix.arch }}" = "arm64" ]; then
225+
sudo -E env "PATH=$PATH" "GOROOT=$GOROOT" make ${{ matrix.test }}_Spt
226+
else
227+
sudo -E env "PATH=$PATH" "GOROOT=$GOROOT" make ${{ matrix.test }}
228+
fi

0 commit comments

Comments
 (0)