2023-01-24 16:00:03 +02:00
|
|
|
name: "Run tests"
|
2022-07-01 16:48:39 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2023-03-02 13:31:05 +02:00
|
|
|
paths-ignore:
|
|
|
|
- "!**.md"
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "master"
|
2022-07-01 16:48:39 +03:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-09-09 16:34:19 +03:00
|
|
|
env:
|
|
|
|
RUST_TEST_THREADS: 1
|
|
|
|
|
2022-07-01 16:48:39 +03:00
|
|
|
jobs:
|
2023-01-24 16:00:03 +02:00
|
|
|
tests:
|
|
|
|
name: "aquavm / cargo test"
|
|
|
|
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
|
|
|
|
2022-11-16 14:49:51 +02:00
|
|
|
- name: Install marine
|
2023-02-21 20:30:22 +03:00
|
|
|
uses: baptiste0928/cargo-install@v1.3.1
|
2022-11-16 14:49:51 +02:00
|
|
|
with:
|
|
|
|
crate: marine
|
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-02 13:31:05 +02:00
|
|
|
- name: Run cargo build
|
|
|
|
run: cargo build
|
2023-02-06 19:59:47 +07:00
|
|
|
|
2022-09-09 16:34:19 +03:00
|
|
|
- name: Run cargo test
|
2023-03-02 13:31:05 +02:00
|
|
|
env:
|
|
|
|
# required by grcov
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
|
|
|
RUSTDOCFLAGS: "-Cpanic=abort"
|
2022-07-01 16:48:39 +03:00
|
|
|
run: |
|
|
|
|
cargo test --release
|
2022-07-08 17:07:04 +03:00
|
|
|
# Check that it does compile
|
|
|
|
cargo bench --no-run
|
|
|
|
# The `memory` sanitizer on cargo test has false positive even on empty project.
|
2022-07-01 16:48:39 +03:00
|
|
|
for san in address leak; do
|
2023-03-02 13:31:05 +02:00
|
|
|
RUSTFLAGS="$RUSTFLAGS -Z sanitizer=$san" cargo test --features test_with_native_code --target x86_64-unknown-linux-gnu
|
2022-07-01 16:48:39 +03:00
|
|
|
done
|
|
|
|
|
2023-03-02 13:31:05 +02:00
|
|
|
- name: Setup grcov
|
|
|
|
uses: SierraSoftworks/setup-grcov@v1
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
version: latest
|
|
|
|
|
|
|
|
- name: Run grcov
|
|
|
|
id: coverage
|
|
|
|
uses: actions-rs/grcov@v0.1
|
|
|
|
|
|
|
|
- name: Coveralls upload
|
|
|
|
uses: coverallsapp/github-action@v1
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
path-to-lcov: ${{ steps.coverage.outputs.report }}
|
|
|
|
|
|
|
|
- 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
|
|
|
|
path: ${{ steps.coverage.outputs.report }}
|
|
|
|
|
|
|
|
lint:
|
|
|
|
name: "aquavm / lints"
|
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: builder
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup rust toolchain
|
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
|
|
|
|
- name: Install marine
|
|
|
|
uses: baptiste0928/cargo-install@v1.3.1
|
|
|
|
with:
|
|
|
|
crate: marine
|
|
|
|
|
|
|
|
- name: Build Wasm binary for tests
|
|
|
|
run: ./build_test_binaries.sh
|
|
|
|
working-directory: air/tests/test_module
|
|
|
|
|
|
|
|
- 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
|