-
Notifications
You must be signed in to change notification settings - Fork 26
161 lines (135 loc) · 5.85 KB
/
consuming.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
150
151
152
153
154
155
156
157
158
159
160
161
---
name: Consuming Projects
on:
pull_request:
types: [labeled, opened, synchronize, reopened]
permissions: {}
jobs:
e2e:
name: E2E Consuming
timeout-minutes: 30
runs-on: ubuntu-latest
if: |
( github.event.action == 'labeled' && github.event.label.name == 'e2e-projects' )
|| ( github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'e2e-projects') )
strategy:
fail-fast: false
matrix:
project: ['admiral', 'lighthouse', 'subctl', 'submariner', 'submariner-operator']
cabledriver: ['libreswan']
# Run most tests against the latest K8s version
k8s_version: ['1.31']
include:
# Test the same set of cable driver combinations as the consuming projects do in their CI
- project: submariner
cabledriver: wireguard
# Test multiple K8s versions only in submariner-operator, balancing coverage and jobs
- project: submariner-operator
# Bottom of supported K8s version range
k8s_version: '1.26'
steps:
- name: Check out the ${{ matrix.project }} repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
# This is replaced to stable branch by auto release process
ref: devel
repository: submariner-io/${{ matrix.project }}
# Check out Shipyard as a sub directory of the project, so that `go replace` can work.
# As it's all run inside an ephemeral container, this way guarantees the Shipyard bits will be readily available for `go replace`.
- name: Check out the Shipyard repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
path: shipyard
- name: Build the latest Shipyard images
run: make -C shipyard images
- name: Copy Shipyard resources
run: cp -n shipyard/{Dockerfile.*,Makefile.dapper,Makefile.shipyard,.dapper} .
- name: Make sure ${{ matrix.project }} is using the built Shipyard image
run: sed -i 's/shipyard-dapper-base:*.*/shipyard-dapper-base:dev/' Dockerfile.dapper
- name: Make sure ${{ matrix.project }} is using the Shipyard go module
run: make go-replace REPLACE=github.com/submariner-io/shipyard=./shipyard
- name: Run E2E deployment and tests
uses: ./shipyard/gh-actions/e2e
with:
k8s_version: ${{ matrix.k8s_version }}
using: ${{ matrix.cabledriver }}
- name: Post mortem
if: failure()
uses: ./shipyard/gh-actions/post-mortem
lint-consuming:
name: Lint
timeout-minutes: 15
runs-on: ubuntu-latest
if: |
( github.event.action == 'labeled' && github.event.label.name == 'lint-projects' )
|| ( github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'lint-projects') )
strategy:
fail-fast: false
matrix:
project: [
'admiral', 'cloud-prepare', 'lighthouse',
'subctl', 'submariner', 'submariner-charts', 'submariner-operator'
]
steps:
- name: Check out the Shipyard repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Build the latest Shipyard image
run: make images
- name: Check out the ${{ matrix.project }} repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
# This is replaced to stable branch by auto release process
ref: devel
repository: submariner-io/${{ matrix.project }}
path: ${{ matrix.project }}
- name: Copy Shipyard resources
run: cp -n Dockerfile.* Makefile.dapper Makefile.shipyard .dapper ${{ matrix.project }}/
- name: Make sure ${{ matrix.project }} is using the built Shipyard image
run: sed -i 's/shipyard-dapper-base:*.*/shipyard-dapper-base:dev/' ${{ matrix.project }}/Dockerfile.dapper
- name: Run golangci-lint
if: always()
run: make -C ${{ matrix.project }} golangci-lint
- name: Run markdownlint
if: always()
run: make -C ${{ matrix.project }} markdownlint
- name: Run packagedoc-lint
if: always()
run: make -C ${{ matrix.project }} packagedoc-lint
- name: Run shellcheck
if: always()
run: make -C ${{ matrix.project }} shellcheck
- name: Run yamllint
if: always()
run: make -C ${{ matrix.project }} yamllint
unit-consuming:
name: Unit Tests
timeout-minutes: 15
runs-on: ubuntu-latest
if: |
( github.event.action == 'labeled' && github.event.label.name == 'unit-projects' )
|| ( github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'unit-projects') )
strategy:
fail-fast: false
matrix:
project: [
'admiral', 'cloud-prepare', 'lighthouse',
'subctl', 'submariner', 'submariner-charts', 'submariner-operator'
]
steps:
- name: Check out the Shipyard repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Build the latest Shipyard image
run: make images
- name: Check out the ${{ matrix.project }} repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
# This is replaced to stable branch by auto release process
ref: devel
repository: submariner-io/${{ matrix.project }}
path: ${{ matrix.project }}
- name: Copy Shipyard resources
run: cp -n Dockerfile.* Makefile.dapper* .dapper ${{ matrix.project }}/
- name: Make sure ${{ matrix.project }} is using the built Shipyard image
run: sed -i 's/shipyard-dapper-base:*.*/shipyard-dapper-base:dev/' ${{ matrix.project }}/Dockerfile.dapper
- name: Run all unit tests
run: make -C ${{ matrix.project }} unit