generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
47c0af9
commit 1951cb8
Showing
2 changed files
with
36 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 |
---|---|---|
|
@@ -255,18 +255,51 @@ jobs: | |
docker exec $CONTAINER_ID bash -c "ruby lib/code_coverage_collate.rb" | ||
docker cp $CONTAINER_ID:/srv/app/coverage/index.html coverage | ||
docker cp $CONTAINER_ID:/srv/app/coverage/assets coverage | ||
docker cp $CONTAINER_ID:/srv/app/coverage/.last_run.json coverage | ||
docker stop $CONTAINER_ID | ||
docker rm $CONTAINER_ID | ||
- name: Store collated test coverage | ||
uses: actions/[email protected] | ||
with: | ||
name: full-coverage-report | ||
path: coverage/* | ||
path: | | ||
coverage/* | ||
!coverage/.last_run.json | ||
- name: Store last run | ||
uses: actions/[email protected] | ||
with: | ||
name: last-run | ||
path: coverage/.last_run.json | ||
- name: Delete intermediate artifacts | ||
uses: geekyeggo/[email protected] | ||
with: | ||
name: coverage-report-* | ||
|
||
comment_coverage: | ||
name: Comment coverage on PR | ||
needs: collate_test_coverage | ||
runs-on: ubuntu-20.04 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
steps: | ||
- name: Download coverage from current run | ||
uses: actions/[email protected] | ||
with: | ||
path: coverage/current | ||
pattern: last-run | ||
- run: echo current_coverage=$(cat coverage/current/last-run/.last_run.json) >> $GITHUB_ENV | ||
- name: Store coverage from current run | ||
id: current-run-coverage | ||
run: | | ||
echo branch=${{ fromJson(env.current_coverage).result.branch }} >> $GITHUB_OUTPUT | ||
echo line=${{ fromJson(env.current_coverage).result.line }} >> $GITHUB_OUTPUT | ||
- name: Post comment | ||
uses: thollander/[email protected] | ||
with: | ||
message: | | ||
# Test coverage | ||
**Line:** ${{ steps.current-run-coverage.outputs.line }}% | ||
**Branch:** ${{ steps.current-run-coverage.outputs.branch }}% | ||
release_dev: | ||
name: Deploy release (Dev) | ||
runs-on: ubuntu-20.04 | ||
|
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