Repository navigation
166 lines (166 loc) · 6.59 KB
/
Copy pathgo.yaml
File metadata and controls
166 lines (166 loc) · 6.59 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
name: Go
on:
workflow_dispatch: null
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Run full test once a day
- cron: "0 0 * * *"
permissions: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
sudo docker image prune --all --force
sudo docker builder prune -a
df -h
# https://github.com/actions/setup-go
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
cache: false
go-version: 1.27.2
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
# Required: the version of golangci-lint is required
# and must be specified without patch version:
# we always use the latest patch version.
version: v2.14.0
install-mode: "binary"
- uses: "pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413" # v6.1.0
with:
version: "12.14.0"
run_install: false
- name: Install Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "26.12.0"
package-manager-cache: false
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.13.1"
enable-cache: false
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
install-only: true
- name: Show GoReleaser version
run: goreleaser --version
- name: Build
# e2e only runs this runner's binary; pushes to main and the nightly run build every platform.
env:
BUILD_FLAGS: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && '--single-target' || '' }}
run: make build
- name: Quick Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make test-short
if: ${{ github.event_name == 'pull_request' }}
- name: All Test
env:
# Access only to ec2 AMI api in read-only
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
UPDATECLI_GITEA_TOKEN: ${{ secrets.UPDATECLI_GITEA_TOKEN }}
run: make test
if: ${{ github.event_name == 'schedule' }}
# Codecov should only be updated if make test is executed
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: ${{ github.event_name == 'schedule' }}
with:
fail_ci_if_error: false
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
# Manage and run your integration tests with efficiency
# https://github.com/ovh/venom
- name: Install Venom
run: |
curl -o /usr/local/bin/venom https://github.com/ovh/venom/releases/download/$VENOM_VERSION/venom.linux-amd64 -L
sudo chmod +x /usr/local/bin/venom
ls -lha /usr/local/bin/venom
env:
VENOM_VERSION: v1.3.0
- name: Show Venom version
run: venom version
# Every HTTP call and resource of the e2e run becomes a span; the collector keeps them in a
# file so the run can be summarized and compared, instead of lost in venom's captured stdout.
- name: Start trace collector
run: |
curl -fsSL -o "$RUNNER_TEMP/otelcol.tar.gz" \
"https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTELCOL_VERSION}/otelcol-contrib_${OTELCOL_VERSION}_linux_amd64.tar.gz"
echo "${OTELCOL_SHA256} $RUNNER_TEMP/otelcol.tar.gz" | sha256sum -c -
tar -xzf "$RUNNER_TEMP/otelcol.tar.gz" -C "$RUNNER_TEMP" otelcol-contrib
mkdir -p "$RUNNER_TEMP/traces"
nohup "$RUNNER_TEMP/otelcol-contrib" --config=env:COLLECTOR_CONFIG >"$RUNNER_TEMP/traces/otelcol.log" 2>&1 &
echo $! >"$RUNNER_TEMP/otelcol.pid"
env:
OTELCOL_VERSION: 0.162.0
OTELCOL_SHA256: fcc063749f730f8c21fe29f2d340ff174f5f1c5885bd3156fb6c985a3036fcc3
COLLECTOR_CONFIG: |
receivers:
otlp:
protocols:
http:
endpoint: 127.0.0.1:4318
exporters:
file:
path: ${env:RUNNER_TEMP}/traces/spans.jsonl
service:
pipelines:
traces:
receivers: [otlp]
exporters: [file]
- name: Run End to End tests
run: make test-e2e
env:
IS_TTY: true # https://github.com/ovh/venom#use-venom-in-ci
# Access only to ec2 AMI api in read-only
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTEL_TRACES_EXPORTER: otlphttp
OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:4318
# The default 2048-span queue drops spans when pipelines finish in bursts.
OTEL_BSP_MAX_QUEUE_SIZE: "262144"
- name: Summarize e2e traces
if: ${{ always() }}
run: |
kill "$(cat "$RUNNER_TEMP/otelcol.pid")" && sleep 2 || true
if [ ! -s "$RUNNER_TEMP/traces/spans.jsonl" ]; then
echo "No e2e traces: the e2e step didn't run." >>"$GITHUB_STEP_SUMMARY"
exit 0
fi
python3 e2e/scripts/trace_summary.py "$RUNNER_TEMP/traces/spans.jsonl" \
--json "$RUNNER_TEMP/traces/summary.json" >>"$GITHUB_STEP_SUMMARY"
- name: Upload e2e traces
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-traces
path: ${{ runner.temp }}/traces
retention-days: 30