-
Notifications
You must be signed in to change notification settings - Fork 17
90 lines (83 loc) · 2.29 KB
/
ci.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
name: ci
on:
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- 'Makefile'
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
"containerd-shim-* -> target"
- run:
rustup toolchain install nightly --component rustfmt
- name: Setup build env
run: |
make setup
- name: fmt
run: |
make fmt
build-wasm-images:
uses: ./.github/workflows/docker-build-push.yaml
with:
test: true
build:
uses: ./.github/workflows/build.yaml
publish-node-installer-image:
uses: ./.github/workflows/node-installer.yaml
needs: build
# This action requires use of the GITHUB_TOKEN to publish the image
# By default, PRs from forks don't have access, so we only run when the PR branch is on origin.
if: ${{ ! github.event.pull_request.head.repo.fork }}
with:
ref: ${{ github.ref }}
test:
needs: build
runs-on: ubuntu-latest
env:
ARCH: x86_64
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: azure/setup-kubectl@v4
- uses: fermyon/actions/spin/setup@v1
with:
version: "v2.7.0"
- name: Setup build env
run: |
make setup
- name: Extract containerd-shim-spin-linux-${{ env.ARCH }}
run: |
mkdir -p ./bin
for f in containerd-shim-spin-*-linux-${{ env.ARCH }}/containerd-shim-spin-*-linux-${{ env.ARCH }}.tar.gz
do tar -xzf "$f" -C ./bin
done
- name: install k3d
run: make install-k3d
- name: run integration tests
run: BIN_DIR="./bin" IS_CI=true make integration-tests
- name: run collect debug logs
if: failure()
run: make tests/collect-debug-logs
- name: upload debug logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: debug-logs
path: debug-logs/
retention-days: 5
- name: Output runner storage on failure
if: failure()
run: df -h
- name: clean up k3d
if: always()
run: make tests/clean