-
Notifications
You must be signed in to change notification settings - Fork 232
114 lines (103 loc) · 2.96 KB
/
ci.yaml
File metadata and controls
114 lines (103 loc) · 2.96 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
name: continuous-integration
on:
push:
branches:
- master
tags:
- v0.*
pull_request:
branches:
- master
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci-unit-tests:
name: ci-unit-tests-${{ matrix.component.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
component:
- name: custom-metrics-stackdriver-adapter
dir: custom-metrics-stackdriver-adapter
build-target: build
- name: prometheus-to-sd
dir: prometheus-to-sd
build-target: build
- name: event-exporter
dir: event-exporter
build-target: build
- name: kubelet-to-gcm
dir: kubelet-to-gcm
build-target: compile
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go from module
uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.component.dir }}/go.mod
cache: true
cache-dependency-path: ${{ matrix.component.dir }}/go.sum
id: go
- name: Unit tests
working-directory: ${{ matrix.component.dir }}
run: make test
ci-build:
name: ci-build-${{ matrix.component.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
component:
- name: custom-metrics-stackdriver-adapter
dir: custom-metrics-stackdriver-adapter
build-target: build
- name: prometheus-to-sd
dir: prometheus-to-sd
build-target: build
- name: event-exporter
dir: event-exporter
build-target: build
- name: kubelet-to-gcm
dir: kubelet-to-gcm
build-target: compile
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go from module
uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.component.dir }}/go.mod
cache: true
cache-dependency-path: ${{ matrix.component.dir }}/go.sum
id: go
- name: Build
working-directory: ${{ matrix.component.dir }}
run: make ${{ matrix.component.build-target }}
- name: Verify Generated
working-directory: ${{ matrix.component.dir }}
run: |
if grep -q "verify-generated:" Makefile; then
make verify-generated
fi
ci-container-build:
name: ci-container-build-${{ matrix.component }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
component:
- custom-metrics-stackdriver-adapter
- prometheus-to-sd
- event-exporter
- kubelet-to-gcm
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build container
working-directory: ${{ matrix.component }}
run: docker build .