Housekeeping #755
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# Adding golang-ci lint as a separate step as the Nix package is currently broken | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.61 | |
args: --timeout=10m | |
test: | |
# The Ubuntu image has been downgraded and pinned for the `test` and `generated` jobs as they are broken on 24.04 | |
runs-on: ubuntu-22.04 | |
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-22.04 | |
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, extract translations 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 i18n-extract | |
nix develop --ignore-environment . --command task build-webui | |
env: | |
POSTGRES_PASSWORD: postgres | |
- name: Check nothing changed | |
# excluding the 3rdpartylicenses file in a horrible hack: | |
run: git diff --exit-code -- . ':(exclude)webui/dist/bitmagnet/3rdpartylicenses.txt' |