-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (62 loc) · 1.54 KB
/
commit.yaml
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
name: commit
on:
push:
branches: [main]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "^1.23"
- uses: golangci/golangci-lint-action@v4
lint-dockerfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:alpine
ports:
- 5432:5432
env:
POSTGRES_DB: template
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
redis:
image: redis
ports:
- 6379:6379
env:
CONFIG_PATH: "${{ github.workspace }}/config/config.yaml"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "^1.22"
- name: migrate
run: go run cmd/migrate/migrate.go up
- name: tests
run: go test -v ./...
release:
needs: [gitleaks, lint-go, lint-dockerfile, test]
runs-on: ubuntu-latest
steps:
- uses: joaofnds/semantic-release-action@v1.4.0
with:
plugins: "conventional-changelog-conventionalcommits"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}