-
Notifications
You must be signed in to change notification settings - Fork 88
85 lines (81 loc) · 2.6 KB
/
ci.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
runs-on: "ubuntu-latest"
steps:
- uses: Swatinem/rust-cache@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
components: rustfmt, clippy
- name: Setup OCI runtime build env
run: |
sudo apt -y update
sudo apt install -y pkg-config libsystemd-dev libdbus-glib-1-dev build-essential libelf-dev libseccomp-dev libclang-dev
- name: Setup WasmEdge build env
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.11.2
echo "LD_LIBRARY_PATH=$HOME/.wasmedge/lib" >> $GITHUB_ENV
- name: Run cargo fmt
run: |
cargo fmt --all -- --check
- name: Run cargo clippy
run: |
cargo clippy --all --all-targets -- -D warnings
build:
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: Swatinem/rust-cache@v2
- name: "check cgroup version"
run: "mount | grep cgroup"
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
- name: Setup OCI runtime build env
run: |
sudo apt -y update
sudo apt install -y pkg-config libsystemd-dev libdbus-glib-1-dev build-essential libelf-dev libseccomp-dev libclang-dev
- name: Setup WasmEdge build env
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.11.2
echo "LD_LIBRARY_PATH=$HOME/.wasmedge/lib" >> $GITHUB_ENV
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --verbose
- name: Validate docs
run: ./scripts/validate-docs.sh
- name: Run tests
run: |
sudo -E LD_LIBRARY_PATH=/home/runner/.wasmedge/lib /home/runner/.cargo/bin/cargo test --all --verbose
e2e:
needs: [build]
strategy:
matrix:
# 20.04 uses cgroupv1, 22.04 uses cgroupv2
os: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- name: "check cgroup version"
run: "mount | grep cgroup"
- uses: actions/checkout@v3
- name: setup rust-wasm target
run: rustup target add wasm32-wasi
- name: run
run: make test/k8s/deploy
- name: cleanup
if: always()
run: make test/k8s/clean