2023-03-31 13:03:23 +03:00
|
|
|
name: Run tests with workflow_call
|
2022-07-01 16:48:39 +03:00
|
|
|
|
|
|
|
on:
|
2023-03-31 13:03:23 +03:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
ref:
|
|
|
|
description: "git ref to checkout to"
|
|
|
|
type: string
|
|
|
|
default: "master"
|
2022-09-09 16:34:19 +03:00
|
|
|
|
2022-07-01 16:48:39 +03:00
|
|
|
jobs:
|
2023-01-24 16:00:03 +02:00
|
|
|
tests:
|
2023-03-31 13:03:23 +03:00
|
|
|
name: "cargo nextest"
|
2023-01-24 16:00:03 +02:00
|
|
|
timeout-minutes: 60
|
2022-07-01 16:48:39 +03:00
|
|
|
runs-on: builder
|
|
|
|
|
2023-03-02 13:31:05 +02:00
|
|
|
permissions:
|
|
|
|
checks: write # for coverall to create checks
|
|
|
|
|
2022-07-01 16:48:39 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-09-09 16:34:19 +03:00
|
|
|
- name: Setup rust toolchain
|
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
2022-07-01 16:48:39 +03:00
|
|
|
|
2023-03-17 11:57:31 +02:00
|
|
|
- name: Setup marine
|
|
|
|
uses: fluencelabs/setup-marine@v1
|
2022-07-01 16:48:39 +03:00
|
|
|
|
2022-09-09 16:34:19 +03:00
|
|
|
- name: Build Wasm binary for tests
|
2022-07-01 16:48:39 +03:00
|
|
|
run: ./build_test_binaries.sh
|
|
|
|
working-directory: air/tests/test_module
|
|
|
|
|
2023-03-17 15:11:46 +02:00
|
|
|
- uses: taiki-e/install-action@cargo-llvm-cov
|
|
|
|
- uses: taiki-e/install-action@nextest
|
2023-02-06 19:59:47 +07:00
|
|
|
|
2023-03-17 15:11:46 +02:00
|
|
|
- run: cargo clean
|
|
|
|
- run: cargo build
|
2023-03-02 13:31:05 +02:00
|
|
|
|
2023-03-31 13:03:23 +03:00
|
|
|
- name: Run cargo nextest
|
|
|
|
run: cargo llvm-cov nextest --release --all-features --profile ci --lcov --output-path lcov.info
|
2023-03-02 13:31:05 +02:00
|
|
|
|
|
|
|
- name: Coveralls upload
|
|
|
|
uses: coverallsapp/github-action@v1
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-03-17 15:11:46 +02:00
|
|
|
path-to-lcov: lcov.info
|
2023-03-02 13:31:05 +02:00
|
|
|
|
|
|
|
- name: Archive code coverage results
|
2023-03-07 11:05:41 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-03-02 13:31:05 +02:00
|
|
|
with:
|
|
|
|
name: code-coverage-report.zip
|
2023-03-17 15:11:46 +02:00
|
|
|
path: lcov.info
|
|
|
|
|
2023-03-31 13:03:23 +03:00
|
|
|
- name: Upload test report
|
|
|
|
uses: dorny/test-reporter@v1
|
|
|
|
if: success() || failure()
|
|
|
|
with:
|
|
|
|
name: aquavm report
|
|
|
|
path: target/nextest/ci/junit.xml
|
|
|
|
reporter: java-junit
|
|
|
|
|
2023-03-17 15:11:46 +02:00
|
|
|
- name: Run tests with test_with_native_code
|
2023-03-31 13:03:23 +03:00
|
|
|
env:
|
|
|
|
RUST_TEST_THREADS: 1
|
2023-03-17 15:11:46 +02:00
|
|
|
run: |
|
|
|
|
# The `memory` sanitizer on cargo test has false positive even on empty project.
|
|
|
|
for san in address leak; do
|
|
|
|
RUSTFLAGS="$RUSTFLAGS -Z sanitizer=$san" cargo test --features test_with_native_code --target x86_64-unknown-linux-gnu
|
|
|
|
done
|
2023-03-02 13:31:05 +02:00
|
|
|
|
|
|
|
- name: Run cargo fmt
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
|
|
|
|
- name: Run cargo check
|
|
|
|
run: cargo check
|
|
|
|
|
2023-03-15 16:59:30 +07:00
|
|
|
- name: Check native aquavm-air-cli
|
|
|
|
run: cargo check --package aquavm-air-cli --no-default-features
|
2023-03-02 13:31:05 +02:00
|
|
|
|
2022-09-09 16:34:19 +03:00
|
|
|
- name: Run cargo clippy
|
2022-07-01 16:48:39 +03:00
|
|
|
run: cargo clippy -v
|