Files
Add-API/.gitea/workflows/main.yml
zomborip 383c38747b
All checks were successful
CI Pipeline for the Go API / Docker Image Build Test (push) Successful in 20s
CI Pipeline for the Go API / Go Vet (basic static check) (push) Successful in 6s
CI Pipeline for the Go API / Go Build & Cross-Compile (push) Successful in 22s
CI Pipeline for the Go API / Kubernetes Smoke Test (push) Successful in 3s
CI Add k8s
2025-10-05 19:31:27 +02:00

81 lines
1.8 KiB
YAML

name: CI Pipeline for the Go API
on:
push:
branches:
- master
jobs:
docker-test:
name: Docker Image Build Test
runs-on: docker-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Docker image
run: |
docker build -t go-api-test .
go-test:
name: Go Vet (basic static check)
runs-on: docker-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check Go version
run: go version
- name: Go Vet (basic static check)
run: go vet ./...
go-build:
name: Go Build & Cross-Compile
runs-on: docker-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check Go version
run: go version
- 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/
k8s-some-test:
name: Kubernetes Smoke Test
runs-on: docker-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure kubeconfig
run: |
mkdir -p ~/.kube
echo "$KUBECONFIG_GITEA" > ~/.kube/config
chmod 600 ~/.kube/config
env:
KUBECONFIG_GITEA: ${{ secrets.KUBECONFIG_GITEA }}
- name: Kubectl test
run: kubectl version --client
- name: K3S Cluster Connection Test
run: kubectl get nodes -o wide