-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.37 KB
/
.go.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
73
74
75
76
77
name: build
on:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: set up go 1.22.0
uses: actions/setup-go@v4
with: { go-version: 1.22.0 }
- name: checkout
uses: actions/checkout@v2
with: { fetch-depth: 0 }
- name: build and test
run: |
go test -v -timeout=100s -covermode=count -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./...
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "mock_" > $GITHUB_WORKSPACE/profile.cov
working-directory: .
env:
TZ: "Asia/Almaty"
CGO_ENABLED: 0
- name: submit coverage
run: |
go install github.com/mattn/goveralls@latest
$(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.2
working-directory: .
args: --timeout 5m
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
- name: set up QEMU
uses: docker/setup-qemu-action@v1
- name: set up Docker Buildx
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
uses: docker/setup-buildx-action@v1
- name: login to ghcr
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and deploy master image to ghcr
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ghcr.io/semior001/groxy:master,ghcr.io/semior001/groxy:${{ github.sha }}
- name: build and deploy tagged (latest) image to ghcr
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ghcr.io/semior001/groxy:latest,ghcr.io/semior001/groxy:${{ github.ref }}