Skip to content

Commit

Permalink
switch to a matrix strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman committed Nov 4, 2024
1 parent 60c1ccd commit 6ff4b75
Showing 1 changed file with 38 additions and 21 deletions.
59 changes: 38 additions & 21 deletions .github/workflows/build_test_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,53 @@ jobs:
CLIENT_SECRET: ${{secrets.client_secret}}
USER_ID: ${{secrets.user_id}}
- run: npm run test

code-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
coverage:
- name: "Abstractions"
path: "./packages/abstractions/coverage"
- name: "Authentication Azure"
path: "./packages/authentication/azure/coverage"
- name: "Authentication Spfx"
path: "./packages/authentication/spfx/coverage"
- name: "Http Fetch"
path: "./packages/http/fetch/coverage"
- name: "Serialization Form"
path: "./packages/serialization/form/coverage"
- name: "Serialization JSON"
path: "./packages/serialization/json/coverage"
- name: "Serialization Text"
path: "./packages/serialization/text/coverage"
- name: "Serialization Multipart"
path: "./packages/serialization/multipart/coverage"
- name: "Bundle"
path: "./packages/bundle/coverage"
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm ci
- run: npm run build
- run: npm run test:coverage
if: ${{ matrix.node-version == '22.x' }}
- name: Code Coverage Report
if: ${{ matrix.node-version == '22.x' }}
- name: Code Coverage Report ${{ matrix.coverage.name }}
uses: irongut/[email protected]
with:
filename: "packages/**/coverage/cobertura-coverage.xml"
filename: ${{ matrix.coverage.path }}/cobertura-coverage.xml
format: markdown
hide_branch_rate: false
output: both
badge: true
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && matrix.node-version == '22.x' }}
with:
recreate: true
path: code-coverage-results.md
- name: Archive coverage files
uses: actions/upload-artifact@v4
with:
name: Coverage files ${{ matrix.node-version }}
path: |
packages/abstractions/coverage
packages/serialization/form/coverage
packages/serialization/json/coverage
packages/serialization/multipart/coverage
packages/serialization/text/coverage
packages/http/fetch/coverage
packages/authentication/azure/coverage
packages/authentication/spfx/coverage
name: Coverage files for ${{ matrix.coverage.name }}
path: ${{ matrix.coverage.path }}


publish-npm:
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'chore: release main') }}"
Expand Down Expand Up @@ -108,7 +125,7 @@ jobs:
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
check-typescript-version-matrix:
runs-on: ubuntu-latest
needs: [build]
needs: [build,code-coverage]
if: always()
steps:
- name: All build matrix options are successful
Expand Down

0 comments on commit 6ff4b75

Please sign in to comment.