Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update the commit status with result of tests #1067

Merged
merged 2 commits into from
Jan 10, 2025
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
20 changes: 19 additions & 1 deletion .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
node-version: [14.x, 16.x, 18.x, 20.x, 21.x, 22.x]

steps:
- name: Set commit status as pending
uses: myrotvorets/set-commit-status-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
context: Tests
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -60,9 +66,21 @@ jobs:
- 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
with:
token: ${{ secrets.GITHUB_TOKEN }}
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
21 changes: 20 additions & 1 deletion .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ jobs:
node-version: [14.x, 16.x, 18.x, 20.x, 21.x, 22.x]

steps:
- name: Set commit status as pending
uses: myrotvorets/set-commit-status-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
context: Tests
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -55,9 +61,22 @@ jobs:
- 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
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ needs.test.result }}
context: Tests


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

steps:
Expand Down
Loading