From ac7f2950b3214c6eb5913f12cd9d7f4a9ce82027 Mon Sep 17 00:00:00 2001 From: Chris Pymm Date: Thu, 9 Jan 2025 20:58:23 +0000 Subject: [PATCH] ci: update the commit status with result of tests --- .github/workflows/deploy-production.yml | 13 +++++++++++++ .github/workflows/publish-package.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index b39b7b1c..628dae56 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -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: deploy tests - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 @@ -59,6 +65,13 @@ jobs: path: package - name: Test that sass can be compiled run: npm run test:sass + - 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 deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index b87e3ba5..34b692b2 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -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: publish tests - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 @@ -54,6 +60,13 @@ jobs: path: package - name: Test that sass can be compiled run: npm run test:sass + - 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 publish: runs-on: ubuntu-latest