v3.5.0 #115
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node CI with NPM | |
on: | |
push: | |
branches: | |
- master | |
- "release/**" | |
pull_request: | |
branches: | |
- master | |
- "release/**" | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
integration-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x, 20.x, 21.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node${{ matrix.node-version }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter over tests | |
run: npx prettier -c test/**/*.ts | |
- name: Run integration tests with NPM | |
if: ${{ matrix.node-version == '16.x' && | |
github.repository_owner == 'onfido' }} | |
run: npm test -- -i | |
env: | |
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }} | |
ONFIDO_SAMPLE_APPLICANT_ID: ${{ secrets.ONFIDO_SAMPLE_APPLICANT_ID }} | |
ONFIDO_SAMPLE_VIDEO_ID_1: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_1 }} | |
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 }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: integration-tests | |
environment: delivery | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }} | |
ref: master | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
registry-url: https://registry.npmjs.org/ | |
- name: Validate release | |
uses: onfido/onfido-actions/release-check@main | |
- name: Install dependencies | |
run: npm ci | |
- name: Build and publish package | |
run: | | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |
- name: Update and commit CHANGELOG.md | |
uses: onfido/onfido-actions/update-changelog@main |