Skip to content

Merge pull request #5 from l-peacock/feature/prValidation #2

Merge pull request #5 from l-peacock/feature/prValidation

Merge pull request #5 from l-peacock/feature/prValidation #2

Workflow file for this run

# Run all Jest tests in the project on Pull Request
# If any tests fail, or if there is insufficient code coverage, the pull request will be blocked.
# This yaml is based on the example provided here:
# https://joelhooks.com/jest-and-github-actions/
name: Run Tests
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install npm and run jest tests
uses: actions/setup-node@v1
with:
node-version: "12"
- run: npm install
- run: npm run test:unit:coverage:

Check failure on line 21 in .github/workflows/runTests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/runTests.yml

Invalid workflow file

You have an error in your yaml syntax on line 21
- name: Tests Passed ✅
if: ${{ success() }}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"context": "tests",
"state": "success",
"description": "Tests passed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
- name: Test Failure ⛔️
if: ${{ failure() }}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"context": "tests",
"state": "failure",
"description": "Tests failed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'