Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
GO_VERSION: '1.25'
NODE_VERSION: '20'

jobs:
backend-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go vet ./...
working-directory: backend

backend-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_DB: sunpath
POSTGRES_USER: sunpath
POSTGRES_PASSWORD: sunpath
ports:
- 5432:5432
options: >-
--health-cmd pg_isready -U sunpath
--health-interval 5s
--health-timeout 3s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go test ./... -count=1 -v 2>&1 | tail -30
working-directory: backend
env:
DATABASE_URL: postgres://sunpath:sunpath@localhost:5432/sunpath?sslmode=disable
REDIS_URL: redis://localhost:6379/0

backend-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go build ./...
working-directory: backend

frontend-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
working-directory: frontend
- run: npx tsc --noEmit
working-directory: frontend

frontend-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
working-directory: frontend
- run: npm run build
working-directory: frontend
Loading