Skip to content

[Steveo] Type publish methods to enforce payloads to be object shaped… #2425

[Steveo] Type publish methods to enforce payloads to be object shaped…

[Steveo] Type publish methods to enforce payloads to be object shaped… #2425

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- run: yarn
- run: yarn build && yarn lint
build:
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgres:
image: postgres
env:
POSTGRES_DB: "steveo_testing"
POSTGRES_HOST_AUTH_METHOD: "trust"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: "Setup Localstack"
run: |
pip install localstack awscli-local[ver1]
docker pull localstack/localstack
docker run --hostname 127.0.0.1 --name kafka -d -p 9092:9092 -e KAFKA_ENABLE_KRAFT=yes -e KAFKA_CFG_NODE_ID=0 -e KAFKA_CFG_PROCESS_ROLES=controller,broker -e KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093 -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT -e KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@127.0.0.1:9093 -e KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER bitnami/kafka:3.5
localstack start -d
localstack wait -t 30
echo "Startup complete"
- name: Configure NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Yarn install
run: yarn install --frozen-lockfile --no-progress
- name: Initialise postgres instance
run: ./bin/initialise.sh
- name: Migrate (publish) db schema
run: |
pushd packages/storage-postgres
npx prisma migrate deploy
popd
env:
DATABASE_URL: postgresql://steveo@localhost:5432/steveo_testing
- name: "Run tests"
run: yarn test
env:
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
DATABASE_URL: postgresql://steveo@localhost:5432/steveo_testing