Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVEXP-590: Improve CI performance #142

Merged
merged 5 commits into from
Oct 2, 2024
Merged
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
38 changes: 21 additions & 17 deletions .github/workflows/run-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
name: Build and test Sinch Node.js SDK

on: [push]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: npx eslint "packages/**/src/**/*.ts"
- run: npx eslint "packages/**/tests/**/*.ts"
- run: yarn run build
- run: yarn run test

e2e:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn install

- name: Run ESLint
run: npx eslint "packages/**/{src,tests}/**/*.ts"

- name: Build project
run: yarn run build

- name: Run unit tests
run: yarn run test

- name: Checkout sinch-sdk-mockserver repository
uses: actions/checkout@v3
with:
repository: sinch/sinch-sdk-mockserver
token: ${{ secrets.PAT_CI }}
fetch-depth: 0
path: sinch-sdk-mockserver

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Start mock servers with Docker Compose
run: |
cd sinch-sdk-mockserver
docker-compose up -d

- name: Create target directories for feature files
run: |
mkdir -p ./packages/fax/tests/e2e/features
Expand All @@ -49,6 +54,7 @@ jobs:
mkdir -p ./packages/sms/tests/e2e/features
mkdir -p ./packages/verification/tests/e2e/features
mkdir -p ./packages/voice/tests/e2e/features

- name: Copy feature files
run: |
cp sinch-sdk-mockserver/features/fax/*.feature ./packages/fax/tests/e2e/features/
Expand All @@ -58,11 +64,9 @@ jobs:
cp sinch-sdk-mockserver/features/sms/*.feature ./packages/sms/tests/e2e/features/
cp sinch-sdk-mockserver/features/verification/*.feature ./packages/verification/tests/e2e/features/
cp sinch-sdk-mockserver/features/voice/*.feature ./packages/voice/tests/e2e/features/

- name: Run e2e tests
run: |
yarn install
yarn run build
yarn run e2e
run: yarn run e2e

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