This repository was archived by the owner on Jul 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
120 lines (101 loc) · 3.47 KB
/
Copy pathci.yaml
File metadata and controls
120 lines (101 loc) · 3.47 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
name: CI
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
pull_request:
branches: [ "main" ]
# Least privilege permissions
permissions:
contents: read
jobs:
lint-and-unit-tests:
name: Lint & Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# Sets up a specific version of Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit uv
uv sync
- name: Run pre-commit hooks
run: |
echo "Running pre-commit hooks..."
pre-commit run --all-files --verbose || {
echo "❌ Pre-commit hooks failed!"
echo ""
echo "Files modified by hooks:"
git diff --name-only
echo ""
echo "Detailed changes:"
git diff --stat
exit 1
}
# Plugin tests
- name: Install nemocheck plugin dependencies
working-directory: ./plugins/examples/nemocheck
run: |
echo "Running nemocheck plugin tests.."
uv sync --all-groups
- name: Run nemocheck plugin tests
working-directory: ./plugins/examples/nemocheck
run: uv run pytest tests
# Server unit tests (no proto generation needed — envoy modules are mocked)
- name: Install server test dependencies
run: uv sync --group dev
- name: Run server unit tests
run: |
echo "Running server unit tests..."
uv run pytest tests/ --ignore=tests/integration
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 15
needs: lint-and-unit-tests
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python 3.11
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.11"
- name: Install uv
run: pip install uv
# Cache compiled protobuf files across CI runs
- name: Extract proto commit hash
id: proto-hash
run: |
echo "hash=$(grep 'ENVOY_DATA_PLANE_COMMIT=' proto-build.sh | cut -d'"' -f2)" >> "$GITHUB_OUTPUT"
- name: Cache protobuf files
id: proto-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
src/envoy
src/xds
src/validate
src/udpa
key: protos-${{ steps.proto-hash.outputs.hash }}
# Build generated protos (gitignored, needed for real envoy imports)
- name: Build protobuf files
if: steps.proto-cache.outputs.cache-hit != 'true'
run: |
uv sync --group proto
USE_HTTPS=true ./proto-build.sh
- name: Install test dependencies
run: uv sync --group dev
- name: Run integration tests
env:
PYTHONPATH: src
run: |
echo "Running integration tests..."
uv run pytest tests/integration/ -v