-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (86 loc) · 2.54 KB
/
haystack.yaml
File metadata and controls
106 lines (86 loc) · 2.54 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# 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: |
make 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
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
deploy:
runs-on: ubuntu-latest
needs: docker-build
# Deploy to Fly.io after Docker image is built and pushed
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: trunk
steps:
- uses: actions/checkout@v4
- name: Setup Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly.io
run: |
cd examples/deployments/fly.io
./deploy.sh
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}