-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.16 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
## This workflow is managed by meta-repo.
# Please do not edit from the cli repo.
on:
push:
branches: [main]
pull_request:
branches: [main]
name: Build and validation
defaults:
run:
shell: bash
jobs:
ci:
strategy:
matrix:
go-version: ['1.18']
platform: [ubuntu-latest]
go-osarch: [ 'darwin/amd64', 'linux/amd64' ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: lint
uses: golangci/golangci-lint-action@v2
with:
args: --verbose
skip-go-installation: true
- name: test
run: go test ./... -v -cover
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.go-osarch}}
GOOS=${GOOSARCH%/*}
GOARCH=${GOOSARCH#*/}
BINARY_NAME=${{github.repository}}-$GOOS-$GOARCH
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: build
run: |
go build -o "$BINARY_NAME" -v