39 lines
794 B
YAML
39 lines
794 B
YAML
name: Backend CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: aliyun
|
|
container: golang:1.23-alpine
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
steps:
|
|
- name: Setup Node.js
|
|
run: |
|
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
|
apk add --no-cache nodejs
|
|
working-directory: /
|
|
|
|
- name: Checkout
|
|
uses: "http://8.161.227.145:3000/huanghaosheng/checkout@releases/v4"
|
|
|
|
- name: Download Dependencies
|
|
run: go mod download
|
|
env:
|
|
GOPROXY: https://goproxy.cn,direct
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Build
|
|
run: go build ./cmd/server
|
|
|
|
- name: Test
|
|
run: go test ./...
|