Skip to content

Workflow file for this run

name: CI - Tests & Lint
env:
PING_URL: ${{secrets.PING_URL}}
OBSERVER_AGENT: ${{secrets.OBSERVER_AGENT}}
SERVICE_NAME: ${{secrets.SERVICE_NAME}}
SERVICE_VERSION: ${{secrets.SERVICE_VERSION}}
INVITE_COMPLEXITY_CODE: ${{secrets.INVITE_COMPLEXITY_CODE}}
SIGNATURE_TYPE: ${{secrets.SIGNATURE_TYPE}}
PORT: ${{secrets.PORT}}
NODE_ENV: ${{secrets.NODE_ENV}}
PROJECT_NAME: ${{secrets.PROJECT_NAME}}
DATABASE_URL: ${{secrets.DATABASE_URL}}
REDIS_URL: ${{secrets.REDIS_URL}}
FRONT_END_INVITE_URL: ${{secrets.FRONT_END_INVITE_URL}}
FRONT_END_AUTH_URL: ${{secrets.FRONT_END_AUTH_URL}}
COOKIE_KEY: ${{secrets.COOKIE_KEY}}
HOST_SENDER: ${{secrets.HOST_SENDER}}
HOST_PORT_SENDER: ${{secrets.HOST_PORT_SENDER}}
NAME_SENDER: ${{secrets.NAME_SENDER}}
NOT_SEND_EMAILS: ${{secrets.NOT_SEND_EMAILS}}
EMAIL_SENDER: ${{secrets.EMAIL_SENDER}}
PASS_SENDER: ${{secrets.PASS_SENDER}}
LOGGING_PROJECT: ${{secrets.LOGGING_PROJECT}}
FIRESTORE_GCP_PROJECT: ${{secrets.FIRESTORE_GCP_PROJECT}}
FIRESTORE_EMULATOR_HOST: ${{secrets.FIRESTORE_EMULATOR_HOST}}
MAX_MEMORY_HEAP: ${{secrets.MAX_MEMORY_HEAP}}
MAX_MEMORY_RSS: ${{secrets.MAX_MEMORY_RSS}}
CREATE_KEY_FUNC_URL: ${{secrets.CREATE_KEY_FUNC_URL}}
UPDATE_KEY_FUNC_URL: ${{secrets.UPDATE_KEY_FUNC_URL}}
DELETE_KEY_FUNC_URL: ${{secrets.DELETE_KEY_FUNC_URL}}
on:
push:
branches:
- "**"
- "!main"
jobs:
unit-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
node: [ 16, 18, 20 ]
steps:
- uses: actions/checkout@v4
id: git-clone
name: Cloning repository
- uses: pnpm/action-setup@v4
id: install-pnpm
name: Installing PNPM
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
id: set-nodejs
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- name: Install dependencies
id: set-deps
run: pnpm install --frozen-lockfile
- name: Run unit tests
id: unit-tests
run: pnpm run test
integration-tests:
runs-on: ubuntu-latest
container: google/cloud-sdk:slim
steps:
- uses: actions/checkout@v4
id: git-clone
name: Cloning repository
- uses: pnpm/action-setup@v4
id: install-pnpm
name: Installing PNPM
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
id: set-nodejs
with:
node-version: 20.x
cache: "pnpm"
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Google auth
uses: google-github-actions/auth@v2
id: gcp-auth
with:
credentials_json: '${{ secrets.SA_GITHUB }}'
- name: Set gcloud
uses: google-github-actions/setup-gcloud@v2
with:
install_components: 'beta,pubsub-emulator'
- name: Install dependencies
id: set-deps
run: pnpm install --frozen-lockfile
- name: Run integrationt tests
id: integration-tests
run: |
sh -c "export NODE_ENV=production && ./tools/tests/pubsub/createAllTopics.sh"
e2e-test:
runs-on: ubuntu-latest
container: ubuntu:latest
services:
db:
image: postgres
env:
POSTGRES_DB: "mydb"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- "5432:5432"
steps:
- uses: actions/checkout@v4
id: git-clone
name: Cloning repository
- uses: pnpm/action-setup@v4
id: install-pnpm
name: Installing PNPM
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
id: set-nodejs
with:
node-version: 20.x
cache: "pnpm"
- name: Google auth
uses: google-github-actions/auth@v2
id: gcp-auth
with:
credentials_json: '${{ secrets.SA_GITHUB }}'
- name: Install dependencies
id: set-deps
run: pnpm install --frozen-lockfile
- name: Run migrations
id: migrations
run: pnpm run migrate:run
- name: Run E2E tests
id: e2e-tests
env:
NODE_ENV: production
GOOGLE_CLOUD_PROJECT: ${{secrets.FIRESTORE_GCP_PROJECT}}
run: pnpm run test:e2e
eslint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
steps:
- uses: actions/checkout@v4
id: git-clone
name: Cloning repository
- uses: pnpm/action-setup@v4
id: install-pnpm
name: Installing PNPM
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
id: set-nodejs
with:
node-version: 20.x
cache: "pnpm"
- name: Install dependencies
id: set-deps
run: pnpm install --frozen-lockfile
- name: Run Eslint
id: eslint
run: pnpm run lint