-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 1.67 KB
/
build-test.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
name: Build And Test
on:
push:
# Does not run on a tag push
branches:
- "main"
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
Build:
strategy:
matrix:
go-version: [1.21.0]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Fetch Repository
uses: actions/checkout@v2
- name: Tidy
run: go mod tidy
- name: Build
run: ./scripts/build.sh
- name: Test
run: go test -v ./... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
docker-build:
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v3
- name: Build Image
run: make docker-build
- name: Run Image
run: |
docker run --name dexus -d -p 8080:8080 --rm dexus:latest
sleep 5
if ! curl -fs localhost:8080/health; then
printf 'err: container is not running properly' >&2
exit 1
fi
docker stop dexus
- name: Deploy Image
run: echo 'TODO'
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54