-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ name: Task - Integration Tests | |
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
coverage: | ||
|
@@ -21,10 +23,30 @@ jobs: | |
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Coverage | ||
run: cargo llvm-cov --codecov --output-path codecov.json | ||
- name: Upload coverage to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
|
||
- name: Build binary | ||
run: | | ||
source <(cargo llvm-cov show-env --export-prefix) | ||
cargo build --bin deoxys --profile dev | ||
- name: Launch Anvil | ||
run: anvil --fork-url $ANVIL_FORK_URL --fork-block-number $ANVIL_BLOCK_NUMBER & | ||
env: | ||
ANVIL_FORK_URL: "https://eth.merkle.io" | ||
ANVIL_BLOCK_NUMBER: 20395662 | ||
|
||
- name: Build and run tests | ||
run: | | ||
source <(cargo llvm-cov show-env --export-prefix) | ||
export COVERAGE_BIN=$(realpath target/debug/deoxys) | ||
rm -f target/madara-* lcov.info | ||
cargo test --profile dev | ||
- name: Generate coverage info | ||
run: | | ||
source <(cargo llvm-cov show-env --export-prefix) | ||
cargo llvm-cov report --cobertura --output-path coverage.cobertura.xml | ||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
files: codecov.json | ||
fail_ci_if_error: false | ||
filename: coverage.cobertura.xml |