-
Notifications
You must be signed in to change notification settings - Fork 114
91 lines (74 loc) · 2.7 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
86
87
88
89
90
91
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
plugin:
name: test_plugin
# We test on `macos-latest` to accurately reflect
# the plugin Wasm binary that we attach to the releases,
# which is built on the latest macOS too.
# This is also helpful for testing fuel
# consumption in tests.
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/ci-shared-setup
with:
os: macos
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Compile plugin
run: cargo build -p javy-plugin --release --target=wasm32-wasip1
- name: Test
env:
CARGO_TARGET_WASM32_WASIP1_RUNNER: wasmtime --dir=.
run: cargo hack test --target=wasm32-wasip1 --workspace --exclude=javy-cli --exclude=javy-runner --each-feature -- --nocapture
- name: Test Runner
run: cargo test --package=javy-runner
- name: Lint
run: |
cargo clippy --workspace \
--exclude=javy-cli \
--exclude=javy-runner \
--exclude=javy-fuzz \
--target=wasm32-wasip1 --all-targets -- -D warnings
# We need to specify a different job for linting `javy-runner` given that
# it depends on Wasmtime and Cranelift cannot be compiled to `wasm32-wasip1`
- name: Lint Runner
run: cargo clippy --package=javy-runner -- -D warnings
- name: Upload plugin to artifacts
uses: actions/upload-artifact@v4
with:
name: plugin
path: target/wasm32-wasip1/release/plugin.wasm
cli:
name: test_cli
runs-on: ubuntu-latest
needs: plugin
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/ci-shared-setup
with:
os: linux
- uses: actions/download-artifact@v4
with:
name: plugin
path: target/wasm32-wasip1/release/
- name: Build test-plugin
run: |
cargo build --package=javy-test-plugin --release --target=wasm32-wasip1
CARGO_PROFILE_RELEASE_LTO=off cargo build --package=javy-cli --release
target/release/javy init-plugin target/wasm32-wasip1/release/test_plugin.wasm -o crates/runner/test_plugin.wasm
- name: Test CLI
run: CARGO_PROFILE_RELEASE_LTO=off cargo test --package=javy-cli --release -- --nocapture
- name: Check benchmarks
run: CARGO_PROFILE_RELEASE_LTO=off cargo check --package=javy-cli --release --benches
- name: Lint
run: |
cargo fmt -- --check
CARGO_PROFILE_RELEASE_LTO=off cargo clippy --package=javy-cli --release --all-targets -- -D warnings