-
Notifications
You must be signed in to change notification settings - Fork 29
38 lines (38 loc) · 1.27 KB
/
common.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
name: common
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
PACKAGEPATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
GOLANGCI_LINT_VERSION: v1.23.7
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
tests:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{ env.PACKAGEPATH }}
- name: Install Go
uses: actions/setup-go@v2-beta
with:
go-version: ${{ matrix.go-version }}
- name: Install golangci-lint
# https://github.com/golangci/golangci-lint#binary
# golangci-lint binary will be installed at path ${{ github.workspace }}/bin with version ${{ env.GOLANGCI_LINT_VERSION }}
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${{ github.workspace }}/bin ${{ env.GOLANGCI_LINT_VERSION }}
- name: Run golangci-lint
run: ${{ github.workspace }}/bin/golangci-lint run
working-directory: ${{ env.PACKAGEPATH }}
- name: Run unit tests
run: make unit
working-directory: ${{ env.PACKAGEPATH }}