Skip to content

SQL: Add Migrations to CI and also break schema into smaller files #32

SQL: Add Migrations to CI and also break schema into smaller files

SQL: Add Migrations to CI and also break schema into smaller files #32

Workflow file for this run

name: "[Build] Server"
on:
push:
branches: [ "master" ]
paths:
- .github/workflows/**
- database/**
- src/**
- rebar.config
- rebar.lock
- rebar-deps.nix
- flake.nix
- flake.lock
pull_request:
branches: [ "master" ]
paths:
- .github/workflows/**
- database/**
- src/**
- rebar.config
- rebar.lock
- rebar-deps.nix
- flake.nix
- flake.lock
permissions:
contents: read
env:
PGHOST: localhost
PGPORT: 5432
PGPASSWORD: admin
PGUSER: admin
PGDATABASE: mmo
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }}
POSTGRES_USER: ${{ env.PGUSER }}
POSTGRES_DATABASE: ${{ env.PGDATABASE }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 10s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
# Mostly to avoid GitHub rate limiting
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- name: Install Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: "[Server] Build"
run: |
nix build .#server
- name: "[Server] Tests"
run: |
nix develop .#ci --impure -c just test
- name: "[Server] Check Migrations"
run: |
nix develop .#ci --impure -c just db-up