Skip to content

Commit

Permalink
add code coverage to wasm build
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga committed Sep 16, 2023
1 parent 0271fdb commit ec97693
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
# SCCACHE_GHA_ENABLED: "true"
# RUSTC_WRAPPER: "sccache"
steps:
# PREP
- name: Check out code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #3.5.2

Expand All @@ -52,7 +53,7 @@ jobs:
./target/srtool
cache-directories: ./runtime
# save-if: ${{ github.ref == 'refs/heads/master' }}

# BUILD
- name: Setup build options
id: buildopt
run: |
Expand All @@ -68,6 +69,7 @@ jobs:
env:
RUSTC_VERSION: ${{ matrix.rust_version }}
BUILD_OPTS: ${{ env.BUILD_OPTS }}
TARPAULIN_VERSION: 0.19.1 # travis-ci codecov generator
with:
image: paritytech/srtool:${{ matrix.rust_version }}
options: --user root -v /home/runner/.cargo:/cargo-home -v ${{ github.workspace }}:/build -e PACKAGE=${{ matrix.package }}
Expand All @@ -80,10 +82,10 @@ jobs:
du -sh /cargo-home/*
echo "---- RUNNING BUILD ----"
/srtool/build --save
- id: set_runtime
run: echo "RUNTIME=$(echo "${{ matrix.package }}" | sed -e "s/-runtime$//")" >> $GITHUB_ENV
- name: upload srtool report
- name: Upload srtool report
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
with:
name: srtool-wasm-report.txt
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ jobs:
env:
TARGET: ${{ matrix.target }}
RUSTC_WRAPPER: "sccache"

- name: generate codecov reports
run: |
if ${{ contains(matrix.target, 'test' ) }}; then
echo "---- GENERATE CODE COVERAGE ----"
echo "Generate code coverage for ${{ matrix.package }}"
cargo binstall cargo-tarpaulin
# make Cargo.toml
cargo +nightly tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml
fi
# UPLOAD REPORTS
- name: Upload codecov report
uses: codecov/codecov-action@v3
with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./coverage1.xml,./coverage2.xml # optional
# flags: unittests # optional
# name: codecov-umbrella # optional
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

benchmark-check:
name: bench-check-${{ matrix.runtime }}
Expand Down

0 comments on commit ec97693

Please sign in to comment.