Skip to content

ci,push: roll back db after blueprint tests #465

ci,push: roll back db after blueprint tests

ci,push: roll back db after blueprint tests #465

Workflow file for this run

on: [push]
name: CI/CD
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.2
env:
POSTGRES_USER: example
POSTGRES_PASSWORD: example
POSTGRES_DB: example
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Racket
uses: Bogdanp/setup-racket@v1.11
with:
variant: CS
version: stable
- name: Install pkg and deps
run: raco pkg install --batch --auto koyo-lib/ koyo-doc/ koyo-test/ koyo/
- name: Run tests for koyo itself
run: raco test -j 4 koyo-test/
env:
KOYO_DATABASE_TESTS: x
KOYO_TEST_DB_HOST: 127.0.0.1
KOYO_TEST_DB_PORT: ${{ job.services.postgres.ports[5432] }}
KOYO_TEST_DB_NAME: example
KOYO_TEST_DB_USERNAME: example
KOYO_TEST_DB_PASSWORD: example
- name: Run tests for standard blueprint
run: ci/test-blueprint.sh standard
env:
DATABASE_URL: postgres://example@127.0.0.1:${{ job.services.postgres.postgres[5432] }}/example
STANDARD_EXAMPLE_TEST_DB_HOST: 127.0.0.1
STANDARD_EXAMPLE_TEST_DB_PORT: ${{ job.services.postgres.ports[5432] }}
STANDARD_EXAMPLE_TEST_DB_NAME: example
STANDARD_EXAMPLE_TEST_DB_USERNAME: example
STANDARD_EXAMPLE_TEST_DB_PASSWORD: example
- name: Run tests for SaaS blueprint
run: ci/test-blueprint.sh saas
env:
DATABASE_URL: postgres://example@127.0.0.1:${{ job.services.postgres.postgres[5432] }}/example
SAAS_EXAMPLE_TEST_DB_HOST: 127.0.0.1
SAAS_EXAMPLE_TEST_DB_PORT: ${{ job.services.postgres.ports[5432] }}
SAAS_EXAMPLE_TEST_DB_NAME: example
SAAS_EXAMPLE_TEST_DB_USERNAME: example
SAAS_EXAMPLE_TEST_DB_PASSWORD: example
- name: Deploy docs
run: ci/docs.sh
env:
KOYO_DOCS_DEPLOY_KEY_PASSPHRASE: ${{ secrets.KOYO_DOCS_DEPLOY_KEY_PASSPHRASE }}
KOYO_DOCS_SSH_HOST: ${{ secrets.KOYO_DOCS_SSH_HOST }}
KOYO_DOCS_SSH_PORT: ${{ secrets.KOYO_DOCS_SSH_PORT }}
if: >-
startsWith(github.ref, 'refs/heads/master')
build_job_admin_frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: 'koyo-job-admin-frontend/package-lock.json'
- run: |
npm install
npm run lint
npm run build
working-directory: 'koyo-job-admin-frontend'