coverage_typescript #1
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
--- | |
name: coverage_typescript | |
env: | |
NODEJS_VERSION: v18.18.2 | |
on: | |
workflow_run: | |
workflows: | |
- Cactus_CI | |
types: | |
- completed | |
jobs: | |
generate_coverage_report: | |
runs-on: ubuntu-22.04 | |
if: ${{ github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
- name: Set up Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ env.NODEJS_VERSION }} | |
- name: Restore Yarn Cache | |
uses: actions/[email protected] | |
with: | |
path: ./.yarn/ | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
- name: Install dependencies and istanbul-merge | |
run: | | |
yarn install | |
yarn add istanbul-merge --dev | |
- name: Download coverage reports | |
uses: actions/[email protected] | |
with: | |
run-id: ${{ github.event.workflow_run.id }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path: ./code-coverage-ts/ | |
- name: Merge and generate coverage reports | |
run: | | |
ls -R ./code-coverage-ts/**/**/ | |
npx istanbul-merge --out coverage.json ./code-coverage-ts/coverage-reports-*/*/coverage-final.json | |
npx istanbul report --include coverage.json --dir cacti html | |
npx istanbul report --include coverage.json --dir cacti text | |
npx istanbul report --include coverage.json --dir cacti text-summary | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
name: code-coverage-report | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |