Skip to content

Commit

Permalink
ci: update the status based on the result of the whole test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispymm committed Jan 9, 2025
1 parent ac7f295 commit bf27151
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
context: deploy tests
context: Tests
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -65,17 +65,22 @@ jobs:
path: package
- name: Test that sass can be compiled
run: npm run test:sass

result:
runs-on: ubuntu-latest
needs: [test]
if: always()
steps:
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@master
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
context: deploy tests
status: ${{ needs.test.result }}
context: Tests

deploy:
runs-on: ubuntu-latest
needs: [build, test]
needs: [result]
if: github.event_name == 'push'
permissions:
id-token: write
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
context: publish tests
context: Tests
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -60,17 +60,23 @@ jobs:
path: package
- name: Test that sass can be compiled
run: npm run test:sass

result:
runs-on: ubuntu-latest
needs: [test]
if: always()
steps:
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@master
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
context: publish tests
status: ${{ needs.test.result }}
context: Tests


publish:
runs-on: ubuntu-latest
needs: [build, test]
needs: [result]
if: github.event_name == 'push'

steps:
Expand Down

0 comments on commit bf27151

Please sign in to comment.