54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Check build frontend and backend
|
|
run-name: ${{ gitea.actor }} is building nixcn-cms check
|
|
on: [push]
|
|
|
|
jobs:
|
|
build-frontend:
|
|
name: Build PNPM Frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install Corepack
|
|
run: npm install corepack
|
|
|
|
- name: Enable Corepack
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Build frontend
|
|
run: pnpm build
|
|
|
|
build-backend:
|
|
name: Build Go Backend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.25.5"
|
|
cache: false
|
|
|
|
- name: Install dependencies
|
|
run: go mod tidy
|
|
|
|
- name: Generate go dependencies
|
|
run: go generate .
|
|
|
|
- name: Build backend
|
|
run: go build -v -o server main.go
|
|
|
|
- name: Run Tests
|
|
run: go test ./...
|