Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ jobs:
- name: Run type checking
run: npm run typecheck

- name: Run tests (non-interactive)
- name: Run tests with coverage (and integration)
env:
USE_REAL_ENV: ${{ vars.USE_REAL_ENV }}
USE_REAL_ENV: true
NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }}
NEW_RELIC_ACCOUNT_ID: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
run: npm run ai:test
NEW_RELIC_ACCOUNT_ID: ${{ vars.NEW_RELIC_ACCOUNT_ID }}
run: npm run ai:test:coverage

- name: Check test coverage
run: npm run test:coverage

- name: Upload coverage reports
- name: Upload coverage reports to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v3
with:
Expand All @@ -53,6 +50,24 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

- name: Upload HTML coverage as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: coverage
retention-days: 7

- name: Append coverage summary to job summary
if: always()
run: |
echo '### Coverage Summary' >> $GITHUB_STEP_SUMMARY
if [ -f coverage/coverage-summary.json ]; then
node -e 'const s=require("./coverage/coverage-summary.json").total; console.log(`All files: statements ${s.statements.pct}% | branches ${s.branches.pct}% | functions ${s.functions.pct}% | lines ${s.lines.pct}%`)' >> $GITHUB_STEP_SUMMARY
else
echo 'coverage-summary.json not found' >> $GITHUB_STEP_SUMMARY
fi

build-and-publish:
needs: test
runs-on: ubuntu-latest
Expand Down
Loading