forked from highfidelity/hifi-spatial-audio-js
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (63 loc) · 2.94 KB
/
run-integration-tests.yml
File metadata and controls
78 lines (63 loc) · 2.94 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Run-Jest-Integration-Tests
on:
workflow_dispatch:
inputs:
stackname:
description: "Host name, i.e. 'api.highfidelity.com', `api-staging-latest.highfidelity.com`, or 'api-pro-east.highfidelity.com'"
required: true
default: api-staging-latest.highfidelity.com
pull_request_target:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
- release
jobs:
Run-Jest-Integration-Tests:
runs-on: ubuntu-latest
if: github.event.pusher.name != 'hifibuild' && github.event.pusher.name != 'dependabot'
env:
TESTING_AUTH_DECRYPTION_KEY: ${{ secrets.TESTING_AUTH_DECRYPTION_KEY }}
STACKNAME: ${{ github.event.inputs.stackname }}
steps:
- name: View Commit Author
run: echo "The last push was made by a user named ${{ github.event.pusher.name }}."
- name: Disallow checks on unsafe code
continue-on-error: false
if: ${{ !contains(github.event.pull_request.labels.*.name, 'safe to test') && github.event_name != 'workflow_dispatch' }}
run: exit 1
- name: Configure Build Environment
shell: bash
id: buildenv
run: |
if [ ${{ github.event_name }} == "workflow_dispatch" ]; then
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV;
else
echo "CHECKOUT_REF=refs/pull/${{ github.event.number }}/merge" >> $GITHUB_ENV;
fi
- uses: actions/checkout@v2
with:
ref: '${{ env.CHECKOUT_REF }}'
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Modules
run: npm i
# Run integration tests
- name: Decrypt auth file
if: always()
run: ./.github/scripts/decryptAuthFile.sh
- name: Run Jest Integration Tests
if: always()
shell: bash
run: |
./node_modules/.bin/jest integration --ci --useStderr 2>&1 | tee testoutput
./testfails.sh
# Final testing status for repo
- name: All 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: Any Test Failed
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 }}" }'