forked from containerd/runwasi
-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (61 loc) · 2.04 KB
/
action-build.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
name: Build shims
on:
workflow_call:
inputs:
os:
required: true
type: string
runtime:
required: true
type: string
target:
required: false
type: string
slug:
required: true
type: string
jobs:
build:
name: build for ${{ inputs.slug }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- name: Setup build env
run: |
os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
./scripts/setup-$os.sh
shell: bash
- uses: actions-rust-lang/setup-rust-toolchain@v1
env:
RUST_CACHE_KEY_OS: rust-cache-${{ inputs.os }}-${{ inputs.slug }}
with:
rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile
- name: Setup cross-rs
if: runner.os == 'Linux'
run: ./scripts/setup-cross.sh ${{ inputs.target }}
- name: Build
run: make build-${{ inputs.runtime }}
- name: Validate docs
if: ${{ inputs.runtime == 'common' }}
run: ./scripts/validate-docs.sh
- name: Run tests
timeout-minutes: 5
run: |
make test-${{ inputs.runtime }}
- name: Package artifacts
if: ${{ inputs.runtime != 'common' }}
shell: bash
run: |
make dist-${{ inputs.runtime }}
# Check if there's any files to archive as tar fails otherwise
if stat dist/bin/* >/dev/null 2>&1; then
tar -czf dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin .
else
tar -czf dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null
fi
- name: Upload artifacts
if: ${{ inputs.runtime != 'common' }}
uses: actions/upload-artifact@master
with:
name: containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}
path: dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz