-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (140 loc) · 5.38 KB
/
Copy pathgate-copilot-regression.yml
File metadata and controls
156 lines (140 loc) · 5.38 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
name: Copilot Regression Guard
permissions:
contents: read
# Rechenaufwand-Score: R=4 (K=4, L=4, N=4) | last-calibrated: 2026-08-25
# Trigger policy: repo framework score calibration for workflow cost controls.
on:
pull_request:
branches: [community, develop]
paths:
- 'tests/CMakeLists.txt'
- 'src/replication/**/*.c'
- 'src/replication/**/*.cc'
- 'src/replication/**/*.cpp'
- 'src/replication/**/*.cxx'
- 'src/replication/**/*.h'
- 'src/replication/**/*.hh'
- 'src/replication/**/*.hpp'
- 'src/replication/**/*.hxx'
- 'include/themis_export.h'
- 'cmake/**/*.cmake'
- 'cmake/**/*.txt'
- 'cmake/**/*.in'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'tools/ci/copilot_regression_guard.py'
- 'tools/tests/test_copilot_regression_guard.py'
- '.github/workflows/gate-copilot-regression.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
copilot-regression-guard:
name: Copilot regression guard (build + pattern checks)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v5 # v5.3.0
with:
python-version: '3.12'
- name: Install test dependencies
run: python -m pip install --upgrade pip pytest
- name: Run guard unit tests
run: python -m pytest tools/tests/test_copilot_regression_guard.py -q
- name: Run guard inventory on repository
run: |
mkdir -p artifacts/copilot-regression-guard
python tools/ci/copilot_regression_guard.py \
--repo-root . \
--cmake-file tests/CMakeLists.txt \
--output-json artifacts/copilot-regression-guard/report.json
- name: "Repro check: strict missing-source detection must fail on broken fixture"
run: |
FIXTURE_DIR="$(mktemp -d)"
mkdir -p "$FIXTURE_DIR"/{src/replication,tests,include,cmake}
cat > "$FIXTURE_DIR"/src/replication/crdt_types.cpp <<'CPP'
int crdt_types_fixture = 1;
CPP
cat > "$FIXTURE_DIR"/tests/CMakeLists.txt <<'CMAKE'
add_executable(test_replication_crdt_types test_replication_crdt_types.cpp)
target_compile_definitions(test_replication_crdt_types PRIVATE THEMIS_TEST_BUILD=1)
CMAKE
cat > "$FIXTURE_DIR"/include/themis_export.h <<'HDR'
#pragma once
#ifdef _WIN32
#if defined(THEMIS_BASE_EXPORTS) || defined(THEMIS_TEST_BUILD)
#define THEMIS_BASE_API __declspec(dllexport)
#else
#define THEMIS_BASE_API __declspec(dllimport)
#endif
#else
#define THEMIS_BASE_API
#endif
HDR
cat > "$FIXTURE_DIR"/cmake/CMakeLists.txt <<'CMAKE'
target_compile_definitions(themis_core PRIVATE THEMIS_BASE_EXPORTS)
CMAKE
set +e
python tools/ci/copilot_regression_guard.py \
--repo-root "$FIXTURE_DIR" \
--cmake-file tests/CMakeLists.txt \
--strict-missing-sources
rc=$?
set -e
if [ "$rc" -eq 0 ]; then
echo "Expected strict guard to fail on missing source linkage fixture"
exit 1
fi
- name: "Repro check: LNK parser must fail on LNK2019 fixture"
run: |
FIXTURE_DIR="$(mktemp -d)"
mkdir -p "$FIXTURE_DIR"/{src/replication,tests,include,cmake}
cat > "$FIXTURE_DIR"/src/replication/crdt_types.cpp <<'CPP'
int crdt_types_fixture = 1;
CPP
cat > "$FIXTURE_DIR"/tests/CMakeLists.txt <<'CMAKE'
add_executable(test_replication_crdt_types test_replication_crdt_types.cpp)
target_compile_definitions(test_replication_crdt_types PRIVATE THEMIS_TEST_BUILD=1)
CMAKE
cat > "$FIXTURE_DIR"/include/themis_export.h <<'HDR'
#pragma once
#ifdef _WIN32
#if defined(THEMIS_BASE_EXPORTS) || defined(THEMIS_TEST_BUILD)
#define THEMIS_BASE_API __declspec(dllexport)
#else
#define THEMIS_BASE_API __declspec(dllimport)
#endif
#else
#define THEMIS_BASE_API
#endif
HDR
cat > "$FIXTURE_DIR"/cmake/CMakeLists.txt <<'CMAKE'
target_compile_definitions(themis_core PRIVATE THEMIS_BASE_EXPORTS)
CMAKE
cat > "$FIXTURE_DIR"/lnk.log <<'LOG'
error LNK2019: unresolved external symbol "public: void CRDTTypes::merge(void)" referenced in function main
LOG
set +e
python tools/ci/copilot_regression_guard.py \
--repo-root "$FIXTURE_DIR" \
--cmake-file tests/CMakeLists.txt \
--build-log "$FIXTURE_DIR"/lnk.log \
--output-json artifacts/copilot-regression-guard/lnk-fixture-report.json
rc=$?
set -e
if [ "$rc" -eq 0 ]; then
echo "Expected LNK fixture to fail guard"
exit 1
fi
- name: Upload guard artifacts
if: always()
uses: actions/upload-artifact@v4 # v7.0.1
with:
name: copilot-regression-guard-${{ github.run_number }}
path: artifacts/copilot-regression-guard/
retention-days: 14