-
Notifications
You must be signed in to change notification settings - Fork 4
149 lines (125 loc) · 4.27 KB
/
compliance.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
137
138
139
140
141
142
143
144
145
146
147
148
149
name: "Compliance"
on:
push:
branches: [main]
workflow_dispatch:
pull_request:
env:
REGISTRY: ghcr.io
jobs:
PromQL:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache: false
- uses: docker/setup-buildx-action@v3
- name: Docker log in
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Get Go environment
id: go-env
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "goversion=$(go env GOVERSION)" >> $GITHUB_ENV
- name: Set up cache
uses: actions/cache@v4
with:
path: |
${{ env.cache }}
${{ env.modcache }}
key: Compliance-${{ runner.os }}-go-${{ env.goversion }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
promql-compliance-${{ runner.os }}-go-${{ env.goversion }}
- name: Go build
env:
CGO_ENABLED: 0
run: |
go build -trimpath -buildvcs=false -v ./cmd/oteldb
- name: Start
working-directory: dev/local/ch-compliance
run: docker compose -f docker-compose.ci.yml up -d --build --force-recreate
- name: Wait
working-directory: dev/local/ch-compliance
run: go run ./cmd/compliance-wait -wait 10s
- name: Run
working-directory: dev/local/ch-compliance
run: |
go run github.com/go-faster/oteldb/cmd/promql-compliance-tester \
-config-file promql-test-queries.yml -config-file test-oteldb.yml \
-output-format json \
-end 1m -range 1m > result.oteldb.json || true
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: result.promql.json
path: dev/local/ch-compliance/result.oteldb.json
if-no-files-found: error
retention-days: 1
- name: Verify
working-directory: dev/local/ch-compliance
run: go run ./cmd/compliance-verify --target 99.60 result.oteldb.json
LogQL:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache: false
- uses: docker/setup-buildx-action@v3
- name: Docker log in
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Get Go environment
id: go-env
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "goversion=$(go env GOVERSION)" >> $GITHUB_ENV
- name: Set up cache
uses: actions/cache@v4
with:
path: |
${{ env.cache }}
${{ env.modcache }}
key: logql-compliance-${{ runner.os }}-go-${{ env.goversion }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
logql-compliance-${{ runner.os }}-go-${{ env.goversion }}
- name: Go build
env:
CGO_ENABLED: 0
run: |
go build -trimpath -buildvcs=false -v ./cmd/oteldb
- name: Start
working-directory: dev/local/ch-logql-compliance
run: docker compose -f docker-compose.ci.yml up -d --build --force-recreate
- name: Run
working-directory: dev/local/ch-logql-compliance
run: |
go run github.com/go-faster/oteldb/cmd/logql-compliance-tester \
-end 1m -range 1m \
-config-file logql-test-queries.yml -config-file test-oteldb.yml \
-output-format json -output-file result.oteldb.json \
-output-unsupported \
-query-parallelism 2 \
-target 90.00
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: result.logql.json
path: dev/local/ch-logql-compliance/result.oteldb.json
if-no-files-found: error
retention-days: 1