-
Notifications
You must be signed in to change notification settings - Fork 41
136 lines (116 loc) · 3.84 KB
/
build.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "**" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: build
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
steps:
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.APP_ID }}
tenant-id: ${{ secrets.AUTH_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v5
with:
go-version: '^1.22.0'
- name: Setup JUnit Report
run: go install github.com/jstemmer/go-junit-report/v2@7933520
- name: Set up tparse
run: go install github.com/mfridman/tparse@latest
- name: Check Format
run: if [ "$(gofmt -d -s -l . | tee /dev/fd/2 | wc -l)" -gt 0 ]; then exit 1; fi
continue-on-error: true
- name: Go Work Sync
run: go work sync
- name: Get dependencies
run: |
cd azkustodata
go get -v -t -d ./...
- name: Build data
run: |
cd azkustodata
go build -v ./...
- name: Run tests data
run: |
cd azkustodata
go test -p 100 -race -coverprofile=coverage.out -json ./... 2>&1 > /tmp/gotest-data.log
env:
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
SECONDARY_ENGINE_CONNECTION_STRING: ${{ secrets.SECONDARY_ENGINE_CONNECTION_STRING }}
SECONDARY_DATABASE: ${{ secrets.SECONDARY_DATABASE }}
GOMAXPROCS: 200
continue-on-error: true
- name: Get dependencies ingest
run: |
cd azkustoingest
go get -v -t -d ./...
- name: Build ingest
run: |
cd azkustoingest
go build -v ./...
- name: Run tests ingest
run: |
cd azkustoingest
go test -p 100 -race -coverprofile=coverage.out -json ./... 2>&1 > /tmp/gotest-ingest.log
env:
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
SECONDARY_ENGINE_CONNECTION_STRING: ${{ secrets.SECONDARY_ENGINE_CONNECTION_STRING }}
SECONDARY_DATABASE: ${{ secrets.SECONDARY_DATABASE }}
BLOB_URI_FOR_TEST: ${{ secrets.BLOB_URI_FOR_TEST }}
GOMAXPROCS: 200
- name: Display tests data
if: always()
run: |
tparse -all -file=/tmp/gotest-data.log
- name: Parse tests data
if: always()
run: cat /tmp/gotest-data.log | go-junit-report -parser gojson > report-data.xml
- name: Display tests ingest
if: always()
run: |
tparse -all -file=/tmp/gotest-ingest.log
- name: Parse tests ingest
if: always()
run: cat /tmp/gotest-ingest.log | go-junit-report -parser gojson > report-ingest.xml
- name: Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: report*.xml
report_individual_runs: true
report_suite_logs: error
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
publish-test-results:
name: "Publish Unit Tests Results"
needs: build
runs-on: ubuntu-latest
if: always()
permissions:
checks: write
pull-requests: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml