Files
CollabTable/.github/workflows/tests.yml
T
Gabriel20xx d4dce959f9
Docker / Docker Build & Push (push) Failing after 48s
Lint / Lint (push) Successful in 14s
Tests / Go backend (push) Failing after 15s
Tests / Dashboard checks (push) Successful in 17s
Migrate SharedCode consumers to Gitea packages
2026-08-06 12:22:44 +02:00

101 lines
2.6 KiB
YAML

name: Tests
on:
push:
branches:
- "**"
paths:
- 'backend/**'
- 'frontend/**'
- '.github/workflows/tests.yml'
pull_request:
branches:
- main
- master
paths:
- 'backend/**'
- 'frontend/**'
- '.github/workflows/tests.yml'
workflow_dispatch: {}
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
jobs:
backend:
name: Go backend
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
- name: Configure Gitea Go registry
working-directory: ${{ github.workspace }}
shell: bash
env:
PACKAGE_REGISTRY_USERNAME: ${{ secrets.PACKAGE_REGISTRY_USERNAME }}
PACKAGE_REGISTRY_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
run: |
set -euo pipefail
if [ -z "$PACKAGE_REGISTRY_USERNAME" ] || [ -z "$PACKAGE_REGISTRY_TOKEN" ]; then
echo 'PACKAGE_REGISTRY_USERNAME and PACKAGE_REGISTRY_TOKEN secrets are required.' >&2
exit 1
fi
netrc_path="$RUNNER_TEMP/gitea-go.netrc"
umask 077
{
printf 'machine repos.gfranz.ch\n'
printf 'login %s\n' "$PACKAGE_REGISTRY_USERNAME"
printf 'password %s\n' "$PACKAGE_REGISTRY_TOKEN"
} > "$netrc_path"
{
printf 'NETRC=%s\n' "$netrc_path"
printf 'GOAUTH=netrc\n'
printf 'GOPROXY=https://repos.gfranz.ch/api/packages/Gabriel20xx/go,https://proxy.golang.org\n'
printf 'GONOSUMDB=repos.gfranz.ch/Gabriel20xx/shared/*\n'
} >> "$GITHUB_ENV"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: backend/go.mod
cache: true
- name: Test
run: go test ./...
frontend:
name: Dashboard checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
registry-url: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
scope: '@gabriel20xx'
node-version: '22'
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check dashboard
run: npm run check