-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (72 loc) · 2.05 KB
/
ci.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
name: CI Build
on:
push:
branches:
- master
pull_request:
branches:
- master
defaults:
run:
shell: bash
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
# caching isn't available for golang <= 1.14
# cache: true
- name: Cache
uses: actions/cache@v3.2.4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomodules-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-gomodules
${{ runner.os }}-
- name: Setup bridger
id: setup
run: |
echo "gcli_ver=$(grep golangci-lint .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
echo "::group::godownload"
make download
echo "::endgroup::"
- name: Run Linter and Review
uses: reviewdog/action-golangci-lint@v2
with:
go_version_file: "go.mod"
reviewdog_version: v0.10.2
reporter: github-pr-review
golangci_lint_version: "v${{ steps.setup.outputs.gcli_ver }}"
cache: false
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
- name: Cache
uses: actions/cache@v3.2.4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomodules-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-gomodules
${{ runner.os }}-
- name: Unit Test and Coverage
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: 7c1eabd638b12563c95fc1e17e4abc2440612eddd97b25273c986b24faddb6ae
with:
coverageCommand: make coverage
prefix: github.com/aztechian/bridgr
coverageLocations: |
${{github.workspace}}/coverage.out:gocov
build:
uses: ./.github/workflows/build.yaml