-
Notifications
You must be signed in to change notification settings - Fork 90
67 lines (64 loc) · 1.96 KB
/
action-test-kind.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
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
name: Run end to end tests on kind
on:
workflow_call:
inputs:
os:
required: true
type: string
runtime:
required: true
type: string
image:
type: string
default: img
test-command:
type: string
required: true
jobs:
e2e-kind:
name: e2e kind test on ${{ inputs.os }} with ${{ inputs.image }}
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-${{ inputs.image }}
path: dist
- name: run
timeout-minutes: 10
run: ${{ inputs.test-command }}
# only runs when the previous step fails
- name: inspect failed pods
if: failure()
run: |
kubectl get pods --all-namespaces
kubectl describe pods --all-namespaces
- name: tar logs
if: failure()
run: |
bin/kind export logs ./kind-logs --name containerd-wasm
tar czf kind-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz -C ./kind-logs .
- name: upload logs
if: failure()
uses: actions/upload-artifact@master
with:
name: kind-logs-${{ inputs.runtime }}-${{ inputs.os }}
path: kind-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz
- name: cleanup
if: always()
run: make test/k8s/clean