This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
70 lines (68 loc) · 2.09 KB
/
ci.yaml
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
name: CI
on:
pull_request:
types: [opened, reopened]
push:
branches: ["**"]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
jobs:
test:
name: Run tests and linters
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: docker://docker.io/library/golang:1.17.1-alpine@sha256:13919fb9091f6667cb375d5fdf016ecd6d3a5d5995603000d422b04583de4ef9
name: Run all tests
env:
CGO_ENABLED: "0"
with:
entrypoint: sh
args: -e -x -c "for dir in ./ ./receiver ; do cd $dir ; go vet ./... && go test ./... ; done"
- uses: docker://docker.io/library/golang:1.17.1-alpine@sha256:13919fb9091f6667cb375d5fdf016ecd6d3a5d5995603000d422b04583de4ef9
name: Ensure main package is functional
env:
CGO_ENABLED: "0"
with:
entrypoint: go
args: run ./ -help
build:
needs: test
name: Build the binary
runs-on: ubuntu-20.04
strategy:
matrix:
GOOS: [linux, darwin]
GOARCH: [amd64, arm64]
steps:
- uses: actions/checkout@v2
- uses: docker://docker.io/library/golang:1.17.1-alpine@sha256:13919fb9091f6667cb375d5fdf016ecd6d3a5d5995603000d422b04583de4ef9
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
CGO_ENABLED: "0"
with:
entrypoint: go
args: build
- uses: actions/upload-artifact@v2
with:
name: hubble-otel-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
path: hubble-otel
images:
needs: test
name: Build container images
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: docker://quay.io/cilium/image-maker:e8f1fa622dfad4250723d55bc6a3dd6d1f0f13cd
env:
ANY_REGISTRY_DISABLE: true
DOCKER_HUB_PUBLIC_ACCESS_ONLY: true
GHCR_USERNAME: $GITHUB_ACTOR
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
entrypoint: make
args: images.hubble-otel images.otelcol PUSH=true