mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-29 12:00:13 +00:00
78 lines
1.6 KiB
YAML
78 lines
1.6 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
secret-scan:
|
|
name: Secret Scan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Run gitleaks
|
|
uses: gitleaks/gitleaks-action@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build:
|
|
name: Frontend & Backend
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FRONTEND_DIR: frontend-modern
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: npm
|
|
cache-dependency-path: frontend-modern/package-lock.json
|
|
|
|
- name: Install frontend dependencies
|
|
working-directory: frontend-modern
|
|
run: npm ci
|
|
|
|
- name: Lint frontend
|
|
working-directory: frontend-modern
|
|
run: npm run lint
|
|
|
|
- name: Frontend unit tests
|
|
working-directory: frontend-modern
|
|
run: npm run test
|
|
|
|
- name: Type-check frontend
|
|
working-directory: frontend-modern
|
|
run: npm run type-check
|
|
|
|
- name: Build frontend bundle (with embed copy)
|
|
run: make frontend
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Go unit tests
|
|
env:
|
|
PULSE_DATA_DIR: /tmp/pulse-test-data
|
|
run: go test ./...
|
|
|
|
- name: Build Pulse backend
|
|
run: go build ./cmd/pulse
|