Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ jobs:
run: npm ci
- name: Run linter over tests
run: npx prettier -c test/**/*.ts
- name: Run integration tests with API token auth
- name: Should run integration tests
id: should-run-integration-tests
if: ${{ matrix.node-version == '20.x' &&
github.repository_owner == 'onfido' &&
(github.event_name == 'pull_request' ||
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'schedule') }}
github.repository_owner == 'onfido' }}
uses: onfido/onfido-actions/should-run-integration-tests@main
- name: Acquire integration test lock
if: steps.should-run-integration-tests.outputs.result == 'true'
uses: onfido/onfido-actions/lock/acquire@main
with:
app-id: ${{ secrets.ONFIDO_CI_LOCK_APP_ID }}
app-private-key: ${{ secrets.ONFIDO_CI_LOCK_PRIVATE_KEY }}
- name: Run integration tests with API token auth
if: steps.should-run-integration-tests.outputs.result == 'true'
run: npm test -- -i
env:
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }}
Expand All @@ -57,11 +63,8 @@ jobs:
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }}
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }}
- name: Run integration tests with OAuth client credentials auth
if: ${{ matrix.node-version == '20.x' &&
github.repository_owner == 'onfido' &&
(github.event_name == 'pull_request' ||
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch') }}
if: ${{ steps.should-run-integration-tests.outputs.result == 'true' &&
github.event_name != 'schedule' }}
run: npm test -- -i
env:
ONFIDO_OAUTH_CLIENT_ID: ${{ secrets.ONFIDO_OAUTH_CLIENT_ID }}
Expand All @@ -71,6 +74,12 @@ jobs:
ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }}
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }}
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }}
- name: Release integration test lock
if: always() && steps.should-run-integration-tests.outputs.result == 'true'
uses: onfido/onfido-actions/lock/release@main
with:
app-id: ${{ secrets.ONFIDO_CI_LOCK_APP_ID }}
app-private-key: ${{ secrets.ONFIDO_CI_LOCK_PRIVATE_KEY }}

publish:
runs-on: ubuntu-latest
Expand Down
Loading