-
Notifications
You must be signed in to change notification settings - Fork 0
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
35 additions
and
9 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: Deploy to Firebase Functions via github action | |
on: | ||
push: | ||
branches: ["feature/*"] | ||
pull_request: | ||
branches: ["feature/*", "main"] | ||
workflow_call: | ||
|
||
jobs: | ||
|
@@ -34,14 +36,6 @@ jobs: | |
id: unit-tests-step | ||
run: find ./* -maxdepth 2 -name ava.config.js -print0 | xargs --null -I {} npx nyc ava --tap | npx tap-junit > test.xml | ||
|
||
# - name: Upload test artifact | ||
# id: upload-test-artifact | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: my-artifact | ||
# path: coverage/lcov-report | ||
# retention-days: 14 | ||
|
||
- name: Publish test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() | ||
|
@@ -51,8 +45,40 @@ jobs: | |
require_passed_tests: true | ||
detailed_summary: true | ||
include_passed: true | ||
|
||
- name: Generate test coverage report | ||
id: unit-tests-cov-step | ||
run: find ./* -maxdepth 1 -name package.json -print0 | xargs --null -I {} npx nyc report --reporter json-summary --reporter cobertura | ||
|
||
- name: Publish test coverage report | ||
uses: sidx1024/[email protected] | ||
with: | ||
coverage_file: "coverage/coverage-summary.json" | ||
coverage_file: "coverage/coverage-summary.json" | ||
|
||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
id: cov-report | ||
with: | ||
filename: coverage/cobertura-coverage.xml | ||
badge: true | ||
format: markdown | ||
indicators: true | ||
output: both | ||
thresholds: '60 80' | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
||
|
||
- name: Add Coverage check | ||
uses: LouisBrunner/[email protected] | ||
if: always() | ||
with: | ||
name: Test coveragec | ||
conclusion: ${{ job.status }} | ||
output: | | ||
{"summary":"${{ steps.cov-report.outputs.summary }}"} |