Skip to content

Merge branch 'main' of github.com:kakucodes/route-warmer #15

Merge branch 'main' of github.com:kakucodes/route-warmer

Merge branch 'main' of github.com:kakucodes/route-warmer #15

Workflow file for this run

name: Unit Test
on:
pull_request:
branches: main
push:
branches:
- main
jobs:
test:
name: unit-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test using Node.js
uses: actions/setup-node@v1
with:
node-version: 20
- run: yarn install
- run: yarn test
- name: Tests ✅
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: Tests 🚨
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 }}"
}'