renovate[bot] ad319cbe5a
chore(deps): update coverallsapp/github-action action to v2 (#533)
* chore(deps): update coverallsapp/github-action action to v2

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Anatoly Laskaris <github_me@nahsi.dev>
2023-04-18 11:06:23 +03:00

111 lines
3.1 KiB
YAML

name: Run tests with workflow_call
on:
workflow_call:
inputs:
ref:
description: "git ref to checkout to"
type: string
default: "master"
cargo-dependencies:
description: "Cargo dependencies map"
type: string
default: "null"
jobs:
tests:
name: "cargo nextest"
timeout-minutes: 60
runs-on: builder
permissions:
checks: write # for coverall to create checks
steps:
- name: Checkout AquaVM
uses: actions/checkout@v3
with:
repository: fluencelabs/aquavm
ref: ${{ inputs.ref }}
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Download marine artifact
id: marine
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: marine
path: ~/.local/bin
- name: Make marine executable
if: steps.marine.outcome == 'success'
run: chmod +x ~/.local/bin/marine
- name: Setup marine
if: steps.marine.outcome == 'failure'
uses: fluencelabs/setup-marine@v1
- name: Set dependencies
if: inputs.cargo-dependencies != 'null'
uses: fluencelabs/github-actions/cargo-set-dependency@main
with:
dependencies: ${{ inputs.cargo-dependencies }}
- name: Build Wasm binary for tests
run: ./build_test_binaries.sh
working-directory: air/tests/test_module
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- run: cargo clean
- run: cargo build
- name: Run cargo nextest
run: cargo llvm-cov nextest --release --all-features --profile ci --lcov --output-path lcov.info
- name: Coveralls upload
if: inputs.cargo-dependencies == 'null'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: lcov.info
- name: Archive code coverage results
if: inputs.cargo-dependencies == 'null' && !github.event.pull_request.head.repo.fork
uses: actions/upload-artifact@v3
with:
name: code-coverage-report.zip
path: lcov.info
- name: Upload test report
uses: dorny/test-reporter@v1
if: (success() || failure()) && !github.event.pull_request.head.repo.fork
with:
name: aquavm report
path: target/nextest/ci/junit.xml
reporter: java-junit
- name: Run tests with test_with_native_code
env:
RUST_TEST_THREADS: 1
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
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo check
run: cargo check
- name: Check native aquavm-air-cli
run: cargo check --package aquavm-air-cli --no-default-features
- name: Run cargo clippy
run: cargo clippy -v