mirror of
https://github.com/bitmagnet-io/bitmagnet.git
synced 2026-05-06 04:16:44 -04:00
c16f76130c
The classifier has been re-implemented and now uses a DSL allowing for full customisation. Several bugs have also been fixed. - Closes https://github.com/bitmagnet-io/bitmagnet/issues/182 - Closes https://github.com/bitmagnet-io/bitmagnet/issues/70 - Closes https://github.com/bitmagnet-io/bitmagnet/issues/68 - Hopefully fixes https://github.com/bitmagnet-io/bitmagnet/issues/126
134 lines
3.3 KiB
YAML
134 lines
3.3 KiB
YAML
name: Checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
pull_request:
|
|
|
|
jobs:
|
|
golangci-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "^1.22"
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@v4
|
|
with:
|
|
version: latest
|
|
args: --timeout=10m
|
|
|
|
go-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "^1.22"
|
|
- name: Run tests
|
|
run: go test -v ./...
|
|
|
|
webui-lint:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: webui
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20.x
|
|
- run: npm ci
|
|
- run: npm run eslint:check
|
|
|
|
webui-test:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: webui
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20.x
|
|
- run: npm ci
|
|
- name: Run headless test
|
|
uses: coactions/setup-xvfb@v1
|
|
with:
|
|
run: npm test
|
|
working-directory: webui
|
|
|
|
prettier:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Prettify code
|
|
uses: creyD/prettier_action@v4.3
|
|
with:
|
|
prettier_options: --check .
|
|
|
|
# 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
|
|
- name: Check nothing changed
|
|
run: git diff --exit-code
|
|
- name: Install Task
|
|
uses: arduino/setup-task@v1
|
|
with:
|
|
version: 3.x
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "^1.22"
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20.x
|
|
- name: Setup protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "23.4"
|
|
- name: Install protoc-gen-go
|
|
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0
|
|
- name: Install web app, apply database migrations, generate code and build web app
|
|
run: |
|
|
(cd webui && npm ci); \
|
|
task migrate; \
|
|
task gen; \
|
|
task build-webui
|
|
env:
|
|
POSTGRES_HOST: localhost
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_NAME: bitmagnet
|
|
- name: Check nothing changed
|
|
run: git diff --exit-code
|