Update staging deployment hosts #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Init | |
run: npm ci | |
- name: Run Coverage | |
run: (npm run coverage 2>&1) | tee /tmp/coverage.out | cat | |
- name: Extract coverage | |
run: echo "COVERAGE=$(cat /tmp/coverage.out | grep "Global test coverage")" >> $GITHUB_ENV | |
- name: Display coverage in Github PR checks | |
# See https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run | |
# and https://www.kenmuse.com/blog/creating-github-checks/ | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | # TODO: Set "failure" conclusion if coverage is too low | |
curl -L -X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GH_TOKEN"\ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/${{ github.repository }}/check-runs \ | |
-d '{"name":"Coverage ratio", "head_sha":"${{ github.event.pull_request.head.sha }}", "status":"completed", "conclusion":"success", "output":{"title":"${{env.COVERAGE}}", "summary":""}}' | |