-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.35 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
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Tests
on:
pull_request:
types: [opened, reopened]
push:
branches:
- '*'
- '!master'
- '!main'
jobs:
tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Java 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Fetch apiUrl
run: echo ::set-output name=apiUrl::$(jq -r .env.apiUrl cypress.json)/ping
id: fetchApiUrl
- name: Run tests
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm run start
wait-on: ${{ steps.fetchApiUrl.outputs.apiUrl }}
- name: Set result_url env var
if: always()
run: echo "result_url=http://mockbin.com/request" >> $GITHUB_ENV
- name: Set github_repo env var
if: always()
run: echo "github_repo=$GITHUB_REPOSITORY" >> $GITHUB_ENV
- uses: joelwmale/webhook-action@master
if: failure()
with:
url: ${{ env.result_url }}
body: '{"assignmentRepository": "${{ env.github_repo }}","status": "failed"}'
- uses: joelwmale/webhook-action@master
if: success()
with:
url: ${{ env.result_url }}
body: '{"assignmentRepository": "${{ env.github_repo }}","status": "passed"}'