Skip to content

Update bank demo to 0.5.32 (#72) #53

Update bank demo to 0.5.32 (#72)

Update bank demo to 0.5.32 (#72) #53

Workflow file for this run

name: CI for Bank demo
on:
push:
branches: [ "main" ]
paths:
- 'bank/**'
- '.github/workflows/bank.yml'
pull_request:
types:
- ready_for_review
- opened
- reopened
- synchronize
paths:
- 'bank/**'
- '.github/workflows/bank.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# Service container for Postgres
services:
# Label used to access the service container.
postgres:
image: postgres:15.4
env:
# Specify the password for Postgres superuser.
POSTGRES_PASSWORD: dbos
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: "Setup postgres config"
run: |
docker exec -i ${{ job.services.postgres.id }} apt update
docker exec -i ${{ job.services.postgres.id }} apt install -y postgresql-15-wal2json
docker exec ${{ job.services.postgres.id }} sh -c 'echo "wal_level=logical" >> /var/lib/postgresql/data/postgresql.conf'
docker restart ${{ job.services.postgres.id }}
- name: Checkout demo app
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
cache-dependency-path: 'bank/bank-backend/package-lock.json'
- name: Install psql
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client coreutils
- name: Setup Postgres
working-directory: bank/
run: scripts/init_postgres.sh
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
# The default PostgreSQL port
POSTGRES_PORT: 5432
POSTGRES_PASSWORD: dbos
BANK_PORT: 8081
- name: Compile Bank Server
working-directory: bank/bank-backend/
run: |
npm ci
npx prisma migrate dev --name init --schema prisma/schema.prisma
npm run lint
npm run build
npm test
env:
PGPASSWORD: bank
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
# The default PostgreSQL port
POSTGRES_PORT: 5432
BANK_PORT: 8081
NPM_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}