-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (57 loc) · 1.57 KB
/
push.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
on:
push:
branches:
- master
env:
GO_VERSION: '^1.21.2'
jobs:
test:
runs-on: ubuntu-latest
steps:
-
name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
-
name: Prepare coverage
run: |
go install github.com/jandelgado/gcov2lcov@latest
-
name: Checkout
uses: actions/checkout@v2
-
name: Prepare coverage report
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
CC_TR_URL: "https://codeclimate.com/downloads/test-reporter"
CC_TR_BIN: "test-reporter-latest-linux-amd64"
run: |
mkdir -p coverage && \
curl -L ${CC_TR_URL}/${CC_TR_BIN} > ./cc-test-reporter && \
chmod +x ./cc-test-reporter && \
./cc-test-reporter before-build
-
name: Run tests
run: |
go test -v ./... -race -coverprofile=coverage/gcov.out -covermode=atomic && \
gcov2lcov -infile=coverage/gcov.out -outfile=coverage/lcov.info
-
name: Push coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
run: |
./cc-test-reporter after-build -t lcov
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: natx
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: natx/synthetic:latest