Skip to content

DEVEXP-337: e2e tests POC #6

DEVEXP-337: e2e tests POC

DEVEXP-337: e2e tests POC #6

Workflow file for this run

name: Build and test Sinch Node.js SDK
on:
push:
branches:
- 'main'
pull_request:
branches: [main]
jobs:
start-mock-server:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
# Start the mock server
- name: Start the mock server
run: |
git clone https://asein_sinch:${{ secrets.PAT_CI }}@github.com/sinch/doppelganger.git sinch-sdk-mockserver
cd sinch-sdk-mockserver
git checkout upgrade-to-typescript
yarn install
yarn run compile
AUTH_PORT=8020 NUMBERS_PORT=8021 SMS_PORT=8022 CONVERSATION_PORT=8023 VERIFICATION_PORT=8024 VOICE_PORT=8025 FAX_PORT=8026 node --experimental-specifier-resolution=node dist/index.js
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
needs: start-mock-server
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# Install dependencies
- run: yarn install
# Run linter for SDK source files
- run: npx eslint "packages/**/src/**/*.ts"
# Run linter for SDK test files
- run: npx eslint "packages/**/tests/**/*.ts"
# Transpile TS code for SDK and examples
- run: yarn run build
# Run unit tests
- run: yarn run test
# Run e2e tests
- run: yarn run e2e