Skip to content

Commit 4b403a0

Browse files
committed
ci: Add build, test, release workflow pipelines
1 parent 5d32ceb commit 4b403a0

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/workflows/build-test.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build And Test
2+
3+
on:
4+
push:
5+
# Does not run on a tag push
6+
branches:
7+
- "*"
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
paths-ignore:
12+
- '**.md'
13+
14+
jobs:
15+
Build:
16+
strategy:
17+
matrix:
18+
go-version: [1.21.0]
19+
platform: [ubuntu-latest]
20+
runs-on: ${{ matrix.platform }}
21+
steps:
22+
- name: Setup Go ${{ matrix.go }}
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
- name: Fetch Repository
27+
uses: actions/checkout@v2
28+
- name: Tidy
29+
run: go mod tidy
30+
- name: Build
31+
run: ./scripts/build.sh
32+
- name: Test
33+
run: go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
34+
docker-build:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Fetch Repository
38+
uses: actions/checkout@v3
39+
- name: Build Image
40+
run: make docker-build
41+
- name: Run Image
42+
run: make docker-run
43+
- name: Deploy Image
44+
run: echo 'TODO'
45+
46+
golangci:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v3
50+
- uses: actions/setup-go@v4
51+
with:
52+
go-version: '1.21'
53+
cache: false
54+
- name: golangci-lint
55+
uses: golangci/golangci-lint-action@v3
56+
with:
57+
version: v1.54

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.21'
23+
cache: false
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v5
26+
with:
27+
distribution: goreleaser
28+
version: latest
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)