Anatolios Laskaris 593083b966
chore(e2e): Make e2e run on forks (#555)
* Use e2e env

* Snapshot env

* Update

* Test

* Update

* Test

* Add comments

* Make linter happy
2023-03-29 12:16:59 +03:00

102 lines
2.5 KiB
YAML

name: "Run tests"
on:
pull_request:
paths-ignore:
- "**.md"
- ".github/**"
- "!.github/workflows/ci.yml"
push:
branches:
- "master"
paths-ignore:
- "**.md"
- ".github/**"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
RUST_TEST_THREADS: 1
jobs:
tests:
name: "aquavm / cargo test"
timeout-minutes: 60
runs-on: builder
permissions:
checks: write # for coverall to create checks
steps:
- uses: actions/checkout@v3
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup marine
uses: fluencelabs/setup-marine@v1
- 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 test
run: cargo llvm-cov nextest --release --all-features --lcov --output-path lcov.info
- name: Coveralls upload
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report.zip
path: lcov.info
- name: Run tests with test_with_native_code
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
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: Setup marine
uses: fluencelabs/setup-marine@v1
- 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
- name: Check native aquavm-air-cli
run: cargo check --package aquavm-air-cli --no-default-features
- name: Run cargo clippy
run: cargo clippy -v