Add GH authentication #84
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
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: Clone sinch-sdk-mockserver repository | |
run: | | |
echo "${{ secrets.PAT_CI }}" | gh auth login --with-token | |
git clone https://github.com/sinch/sinch-sdk-mockserver.git | |
- name: Checkout the dev branch | |
run: | | |
cd sinch-sdk-mockserver | |
git checkout DEVEXP-337_Mockserver-POC | |
- name: Build custom Docker image | |
run: | | |
cd sinch-sdk-mockserver | |
docker build -t sinch-mockserver -f Dockerfile . | |
- 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: | | |
while ! docker inspect --format='{{json .State.Health.Status}}' $(docker-compose ps -q authentication-server) | grep -q '"healthy"'; do | |
echo "Waiting for authentication-server to be healthy..." | |
sleep 2 | |
done | |
while ! docker inspect --format='{{json .State.Health.Status}}' $(docker-compose ps -q fax-server) | grep -q '"healthy"'; do | |
echo "Waiting for fax-server to be healthy..." | |
sleep 2 | |
done | |
- name: Create target directories for feature files | |
run: | | |
mkdir -p ./packages/fax/tests/e2e/features | |
- name: Copy feature files | |
run: | | |
cp sinch-sdk-mockserver/features/fax/*.feature ./packages/fax/tests/e2e/features/ | |
- name: Run e2e tests | |
run: 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 }} |