Gitea CI
This commit is contained in:
67
.gitea/workflow/main.yml
Normal file
67
.gitea/workflow/main.yml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
name: CI Pipeline for the Go API
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker-test:
|
||||||
|
name: 🐳 Docker Image Build Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
concurrency: docker-runner-1
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
sudo docker build -t go-api-test .
|
||||||
|
|
||||||
|
compose-test:
|
||||||
|
name: 🧩 Docker Compose Validation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
concurrency: docker-runner-2
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Validate docker-compose.yml
|
||||||
|
run: |
|
||||||
|
sudo docker-compose config -q
|
||||||
|
|
||||||
|
go-build:
|
||||||
|
name: 🦦 Go Build & Cross-Compile
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
concurrency: docker-runner-3
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Check Go version
|
||||||
|
run: go version
|
||||||
|
|
||||||
|
- name: Go Vet (basic static check)
|
||||||
|
run: go vet ./...
|
||||||
|
|
||||||
|
- name: Build Linux binary
|
||||||
|
run: |
|
||||||
|
mkdir -p build
|
||||||
|
go build -o build/go-api-linux main.go
|
||||||
|
|
||||||
|
- name: Build Windows binary
|
||||||
|
run: |
|
||||||
|
GOOS=windows GOARCH=amd64 go build -o build/go-api.exe main.go
|
||||||
|
|
||||||
|
- name: Show build output
|
||||||
|
run: ls -lh build
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: go-api-binaries
|
||||||
|
path: build/
|
||||||
|
|
||||||
Reference in New Issue
Block a user