Skip to content

Commit

Permalink
Merge pull request #159 from bridie-hifi/2021-07-14-release
Browse files Browse the repository at this point in the history
Merge from main into Release branch
  • Loading branch information
hd23408 authored Jul 14, 2021
2 parents 4c9df73 + 4236972 commit 1a8f5de
Show file tree
Hide file tree
Showing 11 changed files with 954 additions and 290 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}" }'
36 changes: 5 additions & 31 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
name: Run-Jest-Tests
name: Run-Jest-Unit-Tests

on:
workflow_dispatch:
inputs:
stackname:
description: "Host name, i.e. 'api', `api-hobby-latest`, or 'api-pro'"
required: true
default: api-staging-latest
push:
workflow_dispatch:
pull_request:
branches:
- main
- release

pull_request_target:
branches:
- main
- release


jobs:
Run-Jest-Tests:
Run-Jest-Unit-Tests:
runs-on: ubuntu-latest
if: github.event.pusher.name != 'hifibuild'
if: github.event.pusher.name != 'hifibuild' && github.event.pusher.name != 'dependabot'

steps:
- name: View Commit Author
Expand All @@ -43,21 +32,6 @@ jobs:
./node_modules/.bin/jest unit --ci --useStderr 2>&1 | tee testoutput
./testfails.sh
# Run integration tests
- name: Decrypt auth file
if: always()
run: ./.github/scripts/decryptAuthFile.sh
env:
TESTING_AUTH_DECRYPTION_KEY: ${{ secrets.TESTING_AUTH_DECRYPTION_KEY }}
STACKNAME: ${{ github.event.inputs.stackname || 'api-staging-latest' }}

- 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()
Expand Down
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hifi-spatial-audio",
"version": "1.3.0",
"version": "1.4.0",
"description": "The High Fidelity Audio Client Library allows developers to integrate High Fidelity's spatial audio technology into their projects.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
Loading

0 comments on commit 1a8f5de

Please sign in to comment.