mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-05-13 04:01:23 +08:00
58 lines
1.1 KiB
YAML
58 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
backend:
|
|
name: Go Build & Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.21'
|
|
cache-dependency-path: server/go.sum
|
|
|
|
- name: Build
|
|
working-directory: server
|
|
run: go build ./...
|
|
|
|
- name: Test
|
|
working-directory: server
|
|
run: go test ./... -v
|
|
|
|
frontend:
|
|
name: React Build & Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: web
|
|
run: npm ci
|
|
|
|
- name: Type Check
|
|
working-directory: web
|
|
run: npx tsc --noEmit -p tsconfig.json
|
|
|
|
- name: Test
|
|
working-directory: web
|
|
run: npm run test
|
|
|
|
- name: Build
|
|
working-directory: web
|
|
run: npm run build
|