-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (70 loc) · 2.13 KB
/
go.yaml
File metadata and controls
87 lines (70 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This workflow runs quality checks and tests for the golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.6"
- name: Check formatting
run: |
go fmt ./...
if [ -n "$(git diff --name-only)" ]; then
echo "Code is not properly formatted. Please run 'make fmt'"
git diff
exit 1
fi
- name: Run Go vet
run: make lint
- name: Run Shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
make shellcheck
test:
runs-on: ubuntu-latest
needs: quality-checks
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.6"
- name: Test
run: make test
- name: Coverage
run: make coverage
- name: Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
docker-build:
runs-on: ubuntu-latest
needs: [quality-checks, test]
# Only build and push Docker images on main branch after tests pass
# Note: Fly.io deployment happens in a separate workflow (deploy-fly.yaml)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build info
run: make docker-info
- name: Build and push Docker image
run: make docker-push
env:
DOCKER_PUSH: true