Unify static and dynamic codegen (#793) #1675
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
core: | |
name: test_core | |
# We test on `macos-latest` to accurately reflect | |
# the core 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 core | |
run: cargo build -p javy-core --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-config --exclude=javy-runner --each-feature -- --nocapture | |
- name: Test Config | |
run: cargo test --package=javy-config | |
- 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 quickjs_provider to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: provider | |
path: target/wasm32-wasip1/release/javy_quickjs_provider.wasm | |
cli: | |
name: test_cli | |
runs-on: ubuntu-latest | |
needs: core | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/ci-shared-setup | |
with: | |
os: linux | |
- uses: actions/download-artifact@v4 | |
with: | |
name: provider | |
path: target/wasm32-wasip1/release/ | |
- 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 |