-
Notifications
You must be signed in to change notification settings - Fork 16
202 lines (176 loc) · 6.1 KB
/
Copy pathextensions.yaml
File metadata and controls
202 lines (176 loc) · 6.1 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Copyright Built On Envoy
# SPDX-License-Identifier: Apache-2.0
# The full text of the Apache license is available in the LICENSE file at
# the root of the repo.
name: Extensions
on:
push:
branches:
- main
- release/**
pull_request:
branches:
- main
- release/**
env:
GOPROXY: https://proxy.golang.org
jobs:
changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: changes
with:
filters: |
extensions:
- 'extensions/**'
predicate-quantifier: every # Make the filters be AND-ed
token: "" # don't use github api
outputs:
extensions: ${{ steps.changes.outputs.extensions }}
discover:
needs: changes
if: ${{ needs.changes.outputs.extensions == 'true' }}
runs-on: ubuntu-latest
outputs:
rust-extensions: ${{ steps.discover.outputs.rust-extensions }}
extproc-extensions: ${{ steps.discover.outputs.extproc-extensions }}
wasm-extensions: ${{ steps.discover.outputs.wasm-extensions }}
has-composer: ${{ steps.discover.outputs.has-composer }}
steps:
- uses: actions/checkout@v7
- name: Discover extensions
id: discover
run: |
# Discover extensions and their languages
extensions="[]"
for dir in extensions/*/; do
# Skip if not a directory
[ -d "$dir" ] || continue
ext_path=$(basename "$dir")
manifest="$dir/manifest.yaml"
# Skip if no manifest
[ -f "$manifest" ] || continue
# Read name and type from manifest
ext_name=$(yq '.name' "$manifest")
type=$(yq '.type' "$manifest")
# Detect language
lang=""
if [ -f "$dir/Cargo.toml" ]; then
lang="rust"
elif [ -f "$dir/go.mod" ]; then
lang="go"
elif [ "$type" = "lua" ]; then
lang="lua"
fi
echo "Found extension: $ext_name (type=$type, lang=$lang, path=$ext_path)"
# Add to extensions array
if [ -n "$lang" ]; then
extensions=$(echo "$extensions" | jq -c \
--arg name "$ext_name" \
--arg type "$type" \
--arg lang "$lang" \
--arg path "$ext_path" \
'. + [{name: $name, type: $type, language: $lang, path: $path}]')
fi
done
# Filter Rust extensions
rust_extensions=$(echo "$extensions" | jq -c '[.[] | select(.language == "rust")]')
# Filter ExtProc extensions
extproc_extensions=$(echo "$extensions" | jq -c '[.[] | select(.type == "ext_proc")]')
# Filter Wasm extensions
wasm_extensions=$(echo "$extensions" | jq -c '[.[] | select(.type == "wasm")]')
# Check if composer extension exists
has_composer=$(echo "$extensions" | jq '[.[] | select(.name == "composer")] | length > 0')
echo "rust-extensions=$rust_extensions" >> $GITHUB_OUTPUT
echo "extproc-extensions=$extproc_extensions" >> $GITHUB_OUTPUT
echo "wasm-extensions=$wasm_extensions" >> $GITHUB_OUTPUT
echo "has-composer=$has_composer" >> $GITHUB_OUTPUT
echo "Rust extensions: $rust_extensions"
echo "ExtProc extensions: $extproc_extensions"
echo "Wasm extensions: $wasm_extensions"
echo "Has composer: $has_composer"
rust-checks:
needs: discover
if: ${{ needs.discover.outputs.rust-extensions != '[]' }}
uses: ./.github/workflows/extensions-rust.yaml
with:
extensions: ${{ needs.discover.outputs.rust-extensions }}
secrets: inherit
go-checks:
needs: discover
if: ${{ needs.discover.outputs.has-composer == 'true' }}
uses: ./.github/workflows/extensions-go.yaml
secrets: inherit
extproc-checks:
needs: discover
if: ${{ needs.discover.outputs.extproc-extensions != '[]' }}
uses: ./.github/workflows/extensions-extproc.yaml
with:
extensions: ${{ needs.discover.outputs.extproc-extensions }}
secrets: inherit
wasm-checks:
needs: discover
if: ${{ needs.discover.outputs.wasm-extensions != '[]' }}
uses: ./.github/workflows/extensions-wasm.yaml
with:
extensions: ${{ needs.discover.outputs.wasm-extensions }}
secrets: inherit
e2e-check:
runs-on: ubuntu-latest
needs: changes
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- run: make -C extensions/tests/e2e check
e2e:
runs-on: ubuntu-latest
needs: e2e-check
strategy:
fail-fast: false
matrix:
envoy_version:
- dev
- 1.38.0
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Run extension e2e tests
env:
GO_TEST_ARGS: -v
ENVOY_VERSION: ${{ matrix.envoy_version }}
run: make -C extensions/tests/e2e test
- uses: actions/upload-artifact@v7
if: failure()
with:
name: extension-e2e-logs-envoy-${{ matrix.envoy_version }}
path: extensions/tests/e2e/**/*.log
if-no-files-found: ignore
# Aggregate all the required jobs and make it easier to customize CI required jobs
extensions-checks:
runs-on: ubuntu-latest
needs:
- discover
- rust-checks
- go-checks
- extproc-checks
- wasm-checks
- e2e-check
- e2e
# We need this to run always to force-fail (and not skip) if any needed
# job has failed. Otherwise, a skipped job will not fail the workflow.
if: always()
steps:
- run: |
echo "Extension checks completed"
[ "${{
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
}}" == "false" ] || exit 1