-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (148 loc) · 6.34 KB
/
Copy pathtest.yml
File metadata and controls
157 lines (148 loc) · 6.34 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
# .github/workflows/test.yml
name: test
on:
push:
branches: [develop, master]
pull_request:
permissions:
contents: read
concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.12"]
exclude:
- os: macos-latest
python-version: "3.9"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install pytest pytest-cov
- name: Run tests
run: python -m pytest tests/unit tests/integration -v --cov=skills/adr-toolkit/scripts --cov-branch --cov-report=term-missing --cov-fail-under=85
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install mypy
run: pip install mypy
- name: Type-check the fully-typed core modules
run: >-
mypy
skills/adr-toolkit/scripts/core/atomic_io.py
skills/adr-toolkit/scripts/core/telemetry.py
skills/adr-toolkit/scripts/core/contracts.py
--strict
version-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check manifest versions and descriptions are in sync
run: python scripts/sync_version.py --check
examples-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Verify examples workflows execution and parity
run: python scripts/verify_examples.py --check
pr-title-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Validate PR Title Conventional Commits Format
run: |
TITLE="${{ github.event.pull_request.title }}"
echo "Checking PR Title: $TITLE"
REGEX="^(feat|fix|docs|style|refactor|perf|test|chore|ci)(\([a-z0-9-]+\))?!?: .+"
if [[ ! "$TITLE" =~ $REGEX ]]; then
echo "❌ PR Title does not match Conventional Commits format."
echo "Expected format: type(scope): description (e.g. feat(cli): add discover command)"
exit 1
fi
echo "✓ PR Title matches Conventional Commits format."
harness-parity:
# Installs the real Codex CLI and Gemini CLI and drives their own plugin
# commands against this repo, the same way a contributor would. Manifest
# JSON shape is already covered by tests/unit/test_*_adapter.py; this job
# instead proves discovery -> install -> list -> the installed skill
# package's script layer still runs, so an upstream CLI change or a
# manifest edit that breaks real installation fails CI instead of
# surfacing later as a user-reported install failure.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Codex CLI
run: npm install -g @openai/codex@0.151.0
- name: Install Gemini CLI
run: npm install -g @google/gemini-cli@0.46.0
- name: Install Antigravity CLI
run: curl -fsSL https://antigravity.google/cli/install.sh | bash
- name: Verify Codex CLI adapter end to end
run: |
set -euo pipefail
export CODEX_HOME="$(mktemp -d)"
REPO_ROOT="$(pwd)"
codex plugin marketplace add "$REPO_ROOT"
INSTALLED_PATH="$(codex plugin add adr-toolkit@adr-toolkit-marketplace --json | jq -r '.installedPath')"
codex plugin list
SCRATCH="$(mktemp -d)"
cd "$SCRATCH" && git init -q
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" preflight --json | jq -e '.ok == true'
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" init --dir docs/decisions --json | jq -e '.ok == true'
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" validate --dir docs/decisions --json | jq -e '.ok == true'
- name: Verify Antigravity CLI adapter end to end
run: |
set -euo pipefail
export PATH="$HOME/.local/bin:$PATH"
REPO_ROOT="$(pwd)"
mkdir -p adapters/antigravity/skills
ln -s "$REPO_ROOT/skills/adr-toolkit" adapters/antigravity/skills/adr-toolkit
export HOME="$(mktemp -d)"
agy plugin validate "$REPO_ROOT/adapters/antigravity"
agy plugin install "$REPO_ROOT/adapters/antigravity"
agy plugin list
INSTALLED_PATH="$HOME/.gemini/config/plugins/adr-toolkit"
SCRATCH="$(mktemp -d)"
cd "$SCRATCH" && git init -q
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" preflight --json | jq -e '.ok == true'
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" init --dir docs/decisions --json | jq -e '.ok == true'
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" validate --dir docs/decisions --json | jq -e '.ok == true'
- name: Verify Gemini CLI adapter end to end
run: |
set -euo pipefail
REPO_ROOT="$(pwd)"
mkdir -p adapters/gemini-cli/skills
ln -s "$REPO_ROOT/skills/adr-toolkit" adapters/gemini-cli/skills/adr-toolkit
export HOME="$(mktemp -d)"
gemini extensions validate "$REPO_ROOT/adapters/gemini-cli"
printf 'y\ny\n' | gemini extensions install "$REPO_ROOT/adapters/gemini-cli" --consent
gemini extensions list
INSTALLED_PATH="$HOME/.gemini/extensions/adr-toolkit"
SCRATCH="$(mktemp -d)"
cd "$SCRATCH" && git init -q
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" preflight --json | jq -e '.ok == true'
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" init --dir docs/decisions --json | jq -e '.ok == true'
python3 "$INSTALLED_PATH/skills/adr-toolkit/scripts/adr.py" validate --dir docs/decisions --json | jq -e '.ok == true'