-
Notifications
You must be signed in to change notification settings - Fork 95
62 lines (59 loc) · 1.98 KB
/
action-test-k3s.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
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
name: Run end to end tests on k3s
on:
workflow_call:
inputs:
os:
required: true
type: string
runtime:
required: true
type: string
jobs:
e2e-k3s:
name: e2e k3s test on ${{ inputs.os }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Setup build env
run: ./scripts/setup-linux.sh
shell: bash
- name: Download artifacts
uses: actions/download-artifact@master
with:
name: containerd-shim-${{ inputs.runtime }}-x86_64-linux-musl
path: dist
- name: Unpack artifats
shell: bash
run: |
mkdir -p dist/bin
tar -xzf dist/containerd-shim-${{ inputs.runtime }}-x86_64-linux-musl.tar.gz -C dist/bin
- name: Download test image
uses: actions/download-artifact@master
with:
name: test-img
path: dist
- name: run
timeout-minutes: 10
run: make test/k3s-${{ inputs.runtime }}
# only runs when the previous step fails
- name: inspect failed pods
if: failure()
run: |
sudo bin/k3s kubectl get pods --all-namespaces
sudo bin/k3s kubectl describe pods --all-namespaces
- name: tar logs
if: failure()
run: |
sudo journalctl -u k3s-runwasi > k3s.log
sudo tar czf k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz -C . k3s.log -C /var/log/pods . -C /var/lib/rancher/k3s/agent/containerd/ containerd.log
sudo chown ${USER}:${USER} k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz
- name: upload logs
if: failure()
uses: actions/upload-artifact@master
with:
name: k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}
path: k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz
- name: cleanup
if: always()
run: make test/k3s/clean