-
Notifications
You must be signed in to change notification settings - Fork 19
52 lines (52 loc) · 1.6 KB
/
action-build.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
name: build
on:
workflow_call:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
os: "ubuntu-latest",
arch: "x86_64",
}
- {
os: "ubuntu-latest",
arch: "aarch64"
}
env:
ARCH: ${{ matrix.config.arch }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: rust-cache-${{ matrix.config.os }}-${{ matrix.config.arch}}
- name: Setup build env
run: |
make setup
- name: Build spin shim
run: |
VERBOSE=1 make build
- name: Run unit tests spin shim
run: |
VERBOSE=1 make unit-tests
- name: Lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: Package release assets
run: |
mkdir _dist
cp target/${{ matrix.config.arch }}-unknown-linux-musl/release/containerd-shim-spin-v2 _dist/
cd _dist
tar czf containerd-shim-spin-v2-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz containerd-shim-spin-v2
- name: Upload shim artifacts
uses: actions/upload-artifact@v4
with:
name: containerd-shim-spin-v2-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}
path: _dist/containerd-shim-spin-v2-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
retention-days: 5