Skip to content

Commit 4eaa90d

Browse files
Consolidate installer validation workflow
1 parent ec2780e commit 4eaa90d

2 files changed

Lines changed: 103 additions & 44 deletions

File tree

‎.github/workflows/install-smoke.yml‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎.github/workflows/validate.yml‎

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,71 @@
1-
name: Validate content
1+
name: Validate
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77

8+
concurrency:
9+
group: validate-${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
permissions:
913
contents: read
1014

1115
jobs:
1216
validate:
1317
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
outputs:
20+
installer_changed: ${{ steps.changes.outputs.installer_changed }}
1421
steps:
1522
- uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
- name: Detect installer changes
26+
id: changes
27+
env:
28+
EVENT_NAME: ${{ github.event_name }}
29+
EVENT_PATH: ${{ github.event_path }}
30+
run: |
31+
python3 - <<'PY'
32+
import json
33+
import os
34+
import subprocess
35+
36+
with open(os.environ["EVENT_PATH"], encoding="utf-8") as handle:
37+
event = json.load(handle)
38+
base = (
39+
event["pull_request"]["base"]["sha"]
40+
if os.environ["EVENT_NAME"] == "pull_request"
41+
else event.get("before", "")
42+
)
43+
installer_paths = {
44+
".github/workflows/install-smoke.yml",
45+
".github/workflows/validate.yml",
46+
"package.json",
47+
"scripts/build_cursor_rules.py",
48+
"scripts/check_install.py",
49+
"scripts/cli.js",
50+
"scripts/install.py",
51+
"scripts/install.ps1",
52+
"scripts/install.sh",
53+
"tests/test_build_cursor_rules.py",
54+
"tests/test_cli.py",
55+
"tests/test_install.py",
56+
}
57+
changed = True
58+
if base and set(base) != {"0"}:
59+
result = subprocess.run(
60+
["git", "diff", "--name-only", base, "HEAD"],
61+
check=True,
62+
capture_output=True,
63+
text=True,
64+
)
65+
changed = bool(installer_paths.intersection(result.stdout.splitlines()))
66+
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
67+
output.write(f"installer_changed={str(changed).lower()}\n")
68+
PY
1669
- name: Validate skills and subagents
1770
run: python3 scripts/validate_content.py
1871
- name: Validate handoff templates
@@ -25,3 +78,52 @@ jobs:
2578
run: python3 scripts/list_content.py --format markdown
2679
- name: Run tests
2780
run: python3 -m unittest discover -s tests -v
81+
bash:
82+
needs: validate
83+
if: needs.validate.outputs.installer_changed == 'true'
84+
runs-on: ubuntu-latest
85+
timeout-minutes: 5
86+
steps:
87+
- uses: actions/checkout@v6
88+
- name: Smoke-test Bash installer
89+
run: |
90+
install_test_root="$(mktemp -d)"
91+
install_test_home="$install_test_root/home"
92+
install_test_project="$install_test_root/project"
93+
mkdir -p "$install_test_home" "$install_test_project"
94+
env HOME="$install_test_home" bash scripts/install.sh "$install_test_project" codex
95+
python3 scripts/check_install.py \
96+
--project "$install_test_project" \
97+
--target codex \
98+
--mode link
99+
test ! -e "$install_test_home/.claude"
100+
test ! -e "$install_test_home/.codex"
101+
102+
powershell:
103+
needs: validate
104+
if: needs.validate.outputs.installer_changed == 'true'
105+
runs-on: windows-latest
106+
timeout-minutes: 10
107+
steps:
108+
- uses: actions/checkout@v6
109+
- name: Smoke-test PowerShell installer
110+
shell: powershell
111+
run: |
112+
$installTestRoot = Join-Path $env:RUNNER_TEMP "indium-agentkit-install-smoke"
113+
$installTestHome = Join-Path $installTestRoot "home"
114+
$installTestProject = Join-Path $installTestRoot "project"
115+
New-Item -ItemType Directory -Force -Path $installTestHome, $installTestProject | Out-Null
116+
$originalUserProfile = $env:USERPROFILE
117+
try {
118+
$env:USERPROFILE = $installTestHome
119+
.\scripts\install.ps1 -ProjectDir $installTestProject -TargetIde codex
120+
python scripts/check_install.py `
121+
--project $installTestProject `
122+
--target codex `
123+
--mode link
124+
if (Test-Path (Join-Path $installTestHome ".claude")) { throw "unexpected user-scope write" }
125+
if (Test-Path (Join-Path $installTestHome ".codex")) { throw "unexpected user-scope write" }
126+
}
127+
finally {
128+
$env:USERPROFILE = $originalUserProfile
129+
}

0 commit comments

Comments
 (0)