-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (51 loc) · 2.02 KB
/
go.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Unittest
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
strategy:
matrix:
goos: [ linux, darwin, windows ]
goarch: [ amd64, arm64 ]
include:
- goos: windows
exclude:
- goos: windows
goarch: arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: goid_init
run: chmod +x goid_init.sh && ./goid_init.sh
- name: Install go-junit-report
run: go install github.com/jstemmer/go-junit-report/v2@latest
- name: Clean
run: rm -f sdk/meta/*.dat && rm -fr example/target && rm -fr example/ellyn_agent && find . -name "*.logging" -exec rm -f {} \;
- name: Build
run: go build -v ./...
- name: Test Ellyn
run: go test -v -coverprofile="coverage.txt" -coverpkg="$(go list -mod=mod ./... | tr '\n' ',')" ./... 2>&1 | tee output.txt && cat output.txt | go-junit-report -set-exit-code > junit.xml
- name: Update example
run: go test -v -run TestExample ./instr
- name: Test Example
run: cd example && go test -v -coverprofile="coverage_example.txt" -coverpkg="example,github.com/lvyahui8/ellyn/sdk/agent,github.com/lvyahui8/ellyn/api" ./... 2>&1 | tee output.txt && cat output.txt | go-junit-report -set-exit-code > ../junit_example.xml
- name: Run Benchmark
run: bash ./benchmark/benchmark.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}