-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (62 loc) · 1.81 KB
/
build-golang.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
name: Golang
on:
workflow_call:
workflow_dispatch:
pull_request:
paths:
- "go/**"
- "proto/**"
- ".github/workflows/*golang*"
- "devops/**"
push:
branches:
- main
paths:
- "go/**"
- "proto/**"
- ".github/workflows/*golang*"
- "devops/**"
jobs:
build-and-test-golang:
name: Build, Test
runs-on: ${{ matrix.os-artifact[0] }}
strategy:
fail-fast: false
matrix:
os-artifact: [ [ubuntu-latest, linux], [windows-latest, windows-gnu], [macos-latest, macos] ]
steps:
- uses: actions/checkout@v3
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-libs.yml"
path: ./libs/${{ matrix.os-artifact[1] }}
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ matrix.os-artifact[1] }}
- name: Set up Go (default)
uses: actions/setup-go@v3
with:
go-version: ^1.17
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Build and Test Golang
run: |
go version
python ../../devops/build_sdks.py --language=golang
go build
go get .out
go test -v -race -covermode atomic -coverprofile coverage.out
shell: pwsh
working-directory: go/okapi
env:
OKAPI_LIBRARY_PATH: "${{ github.workspace }}/libs"
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
GO111MODULE: on
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
directory: go/okapi
token: ${{ secrets.CODECOV_TOKEN }}