This commit is contained in:
zhangchao
2024-10-31 19:37:28 +08:00
parent fbb8f96b89
commit 95a492bd10
2 changed files with 21 additions and 1 deletions

View File

@@ -4,7 +4,27 @@ on:
branches: [ master ]
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build project
run: |
go build -v ./...
- name: Test with the Go CLI
run: go test
docker:
needs: build
runs-on: ubuntu-latest
steps:

View File

@@ -1,5 +1,5 @@
# 使用官方的 Go 运行时作为基础镜像
FROM golang:1.18-alpine AS builder
FROM golang:latest AS builder
# 设置工作目录
WORKDIR /app