-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from madara-alliance/feat/adding-codecov-report
feat : added test coverage
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -5,11 +5,16 @@ on: | |
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test_bridge: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# selecting a toolchain either by action or manual `rustup` calls should happen | ||
# before the plugin, as the cache uses the current rustc version as its cache key | ||
|
@@ -20,6 +25,10 @@ jobs: | |
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Install tarpauline | ||
run: | | ||
cargo install cargo-tarpaulin | ||
- name: Run anvil | ||
run: | | ||
anvil </dev/null &>/dev/null & | ||
|
@@ -30,7 +39,24 @@ jobs: | |
echo "Running madara...." | ||
./run_madara.sh | ||
- name: Check if secret is accessible | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
if [ -n "CODECOV_TOKEN" ]; then | ||
echo "Secret is accessible" | ||
else | ||
echo "Secret is not accessible" | ||
exit 1 | ||
fi | ||
- name: Run tests | ||
run: | | ||
echo "Running test...." | ||
RUST_LOG=info cargo test -- --nocapture | ||
cargo tarpaulin --out Html | ||
sleep 5 # sleeping for few secs to ensure the coverage file is generated. | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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