-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 1.46 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Tests CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test using Node.js
uses: actions/setup-node@v1
with:
node-version: '14'
- run: npm install
- run: npm run build
- run: npm run test:ci
- 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": "Test Cases",
"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": "Test Cases",
"state": "failure",
"description": "Tests failed",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'