-
-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (76 loc) · 2.12 KB
/
ci.yml
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
78
79
80
81
82
83
84
name: checking
on:
pull_request:
branches: [ '*' ]
paths:
- '.github/workflows/ci.yml'
- '**.go'
- '!tools/*.go'
push:
branches: [ '*' ]
paths:
- '.github/workflows/ci.yml'
- '**.go'
- '!tools/*.go'
tags: [ '!*' ]
jobs:
test:
strategy:
matrix:
go:
- 1.x
- 1.17.x
- 1.18.x
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with: { fetch-depth: 0 }
- uses: actions/setup-go@v3
with: { go-version: '${{ matrix.go }}' }
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: make env deps-fetch test-with-coverage
- uses: actions/upload-artifact@v3
if: ${{ matrix.go == '1.18.x' }}
with:
name: code-coverage-report
path: c.out
- run: make install
- run: '[ $(ls bin/linux/*/* | wc -l) = 1 ]'
coverage:
needs: [ test ]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with: { fetch-depth: 0 }
- uses: actions/download-artifact@v3
with:
name: code-coverage-report
- run: |
echo "MODULE=$(grep module go.mod | awk '{print $2}')" >> $GITHUB_ENV
- uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: c.out:gocov
debug: true
prefix: ${{ env.MODULE }}
notify:
needs: [ test ]
if: ${{ failure() || success() }}
runs-on: ubuntu-18.04
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ needs.test.result }}
SLACK_ICON: https://github.com/github.png?size=64
SLACK_TITLE: '${{ github.repository }}: ${{ github.workflow }}'
SLACK_USERNAME: GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}