Skip to content

Split gen task to individual tasks #554

Split gen task to individual tasks

Split gen task to individual tasks #554

Workflow file for this run

name: Checks
on:
push:
branches:
- main
- develop
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install web UI
run: |
nix develop --ignore-environment --command task install-webui
- name: Run linters
run: |
nix develop --ignore-environment --keep HOME . --command task lint
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install web UI
run: |
nix develop --ignore-environment --command task install-webui
- name: Run tests
run: |
nix develop --ignore-environment --keep HOME . --command task test
# This job runs all code generations and builds the WebUI, to check that everything is correctly committed
generated:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:16-alpine
# Provide the password for postgres
env:
PGUSER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bitmagnet
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install web UI, apply database migrations, generate code and build web app
run: |
nix develop --ignore-environment --command task install-webui
nix develop --ignore-environment --keep HOME --keep POSTGRES_PASSWORD . --command task migrate
nix develop --ignore-environment --keep HOME --keep POSTGRES_PASSWORD . --command task gen
nix develop --ignore-environment . --command task build-webui
env:
POSTGRES_PASSWORD: postgres
- name: Check nothing changed
run: git diff --exit-code