Skip to content

ci: make the PR-related jobs fail afer 5 minutes #72

ci: make the PR-related jobs fail afer 5 minutes

ci: make the PR-related jobs fail afer 5 minutes #72

Workflow file for this run

# Generate code coverage reports and uploads them to Codecov
name: 🐛 Code coverage
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
generate:
name: Generate coverage reports
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
shell: bash
outputs:
reports_path: ${{ steps.list_reports_path.outputs.reports_path }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Install
run: node common/scripts/install-run-rush.js install
- name: 🏗 Build
run: node common/scripts/install-run-rush.js rebuild
- name: 🐛 Test
run: node common/scripts/install-run-rush.js test --coverage
- name: List module names for which a coverage report has been generated
id: list_reports_path
# directories_names is an array of strings formatted like that: ./modules/common/coverage.
# syntax checked with https://www.shellcheck.net/
# https://yaml-multiline.info/
run: |
reports_path=$(find ./modules -name clover.xml | tr '\n' ',')
echo "reports_path=$reports_path" >> "$GITHUB_OUTPUT"
- name: ⤒ Upload coverage reports
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ${{ steps.list_reports_path.outputs.reports_path }}