-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (77 loc) · 2.74 KB
/
run-ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build and test Sinch Node.js SDK
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use 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: 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: Build custom Docker image
run: |
cd sinch-sdk-mockserver
docker build -t sinch-sdk-mockserver -f Dockerfile .
- 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: Wait for the mock servers to be healthy
run: |
cd sinch-sdk-mockserver
chmod +x ./scripts/healthcheck.sh
./scripts/healthcheck.sh
- name: Create target directories for feature files
run: |
mkdir -p ./packages/fax/tests/e2e/features
mkdir -p ./packages/numbers/tests/e2e/features
mkdir -p ./packages/conversation/tests/e2e/features
mkdir -p ./packages/elastic-sip-trunking/tests/e2e/features
- name: Copy feature files
run: |
cp sinch-sdk-mockserver/features/fax/*.feature ./packages/fax/tests/e2e/features/
cp sinch-sdk-mockserver/features/numbers/*.feature ./packages/numbers/tests/e2e/features/
cp sinch-sdk-mockserver/features/conversation/*.feature ./packages/conversation/tests/e2e/features/
cp sinch-sdk-mockserver/features/elastic-sip-trunking/*.feature ./packages/elastic-sip-trunking/tests/e2e/features/
- name: Run e2e tests
run: |
yarn install
yarn run build
yarn run e2e
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.PAT_CI }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}