-
Notifications
You must be signed in to change notification settings - Fork 39
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
1 parent
e5ddb70
commit a6e917e
Showing
1 changed file
with
71 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Coverage | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: read-all | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
uses: unionlabs/workflows/.github/workflows/build.yml@d051991e4b808b70746fbef3900ed33307a65db6 | ||
secrets: | ||
nixbuild_token: ${{ secrets.nixbuild_token }} | ||
access-tokens: github.com=${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filter_builds: '(.top_attr == "packages") and (.system == "x86_64-linux") and (.attr == "evm-coverage")' | ||
|
||
|
||
dl-lcov: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
permissions: write-all | ||
strategy: | ||
matrix: | ||
system: [ x86_64-linux ] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: packages.${{ matrix.system }}.evm-coverage | ||
- uses: nixbuild/nix-quick-install-action@v22 | ||
- uses: nixbuild/nixbuild-action@master | ||
with: | ||
nixbuild_token: ${{ secrets.nixbuild_token }} | ||
- run: mkdir ${{ matrix.system }} | ||
- run: | | ||
echo "Getting OUTPUT and NARINFO_NAME" | ||
OUTPUT=`cat result.json | jq -r '.packages."${{ matrix.system }}".evm-coverage.outputs.out'` | ||
NARINFO_NAME=$(basename "$OUTPUT" | cut -d'-' -f1) | ||
echo "Copying artifacts from nixbuild.net" | ||
nix copy --to file://`pwd`/${{ matrix.system }} --from ssh-ng://eu.nixbuild.net $OUTPUT --extra-experimental-features nix-command | ||
echo "Get the NAR_URL" | ||
nar_url_line=$(cat ./${{ matrix.system }}/${NARINFO_NAME}.narinfo | grep "URL:") | ||
NAR_URL=$(echo "$nar_url_line" | cut -d " " -f 2-) | ||
echo "Restore the package from the NAR_URL archive" | ||
cat ${{ matrix.system }}/${NAR_URL} | xz -dc | nix-store --restore ${{ matrix.system }}.evm-coverage | ||
mv ${{ matrix.system }}.evm-coverage/lcov.info lcov.info | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: lcov.info | ||
path: lcov.info | ||
|
||
coverage_report: | ||
- uses: actions/download-artifact@v3 | ||
- name: Report code coverage | ||
uses: zgosalvez/github-actions-report-lcov@v3 | ||
with: | ||
coverage-files: lcov.*.info | ||
minimum-coverage: 90 | ||
artifact-name: code-coverage-report | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
working-directory: apps/my-first-app | ||
update-comment: true |