Skip to content

refactor: use tutor price instead of static platform price #1786

refactor: use tutor price instead of static platform price

refactor: use tutor price instead of static platform price #1786

Workflow file for this run

name: Backend
on:
pull_request:
branches:
- "master"
paths:
- "services/server/**"
- "packages/auth/**"
- "packages/models/**"
- "packages/atlas/**"
- "packages/utils/**"
- "packages/types/**"
workflow_dispatch:
# @ref https://docs.github.com/en/actions/use-cases-and-examples/using-containerized-services/creating-postgresql-service-containers
jobs:
main:
runs-on: ubuntu-latest
container: ubuntu
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: litespace
POSTGRES_DB: test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis/redis-stack-server:7.2.0-v6
options: >-
--health-cmd "redis-cli --raw incr ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
kafka:
image: apache/kafka-native
ports:
# Maps tcp port 5432 on service container to the host
- 9092:9092
env:
# Auto create topics on first use
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
# Configure listeners for both docker and host communication
KAFKA_LISTENERS: CONTROLLER://localhost:9091,HOST://0.0.0.0:9092,DOCKER://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: HOST://localhost:9092,DOCKER://kafka:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,DOCKER:PLAINTEXT,HOST:PLAINTEXT
# Settings required for KRaft mode
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9091
# Listener to use for broker-to-broker communication
KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
# Required for a single node cluster
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20.11.1"
- name: Enable pnpm
run: corepack enable pnpm
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build packages
run: pnpm build:server:pkgs
- name: Run models tests
run: pnpm run models test:ci
- name: Run server in the background
run: pnpm run server start:ci:test:server:bg
- name: Wait for the server to be ready
run: pnpm run server wait
- name: Run server tests
run: pnpm run server test:ci