Skip to content

Commit ef42b1b

Browse files
xnotoclaude
andauthored
ci: split test-and-sync into two workflows (#36)
## Summary The previous \`test-and-sync.yml\` had both jobs in one workflow, with the sync job gated by \`if: github.event_name == 'push' && github.ref == 'refs/heads/main'\`. That made \`Sync ArgoCD\` appear as a \`skipping\` entry on every PR's check list — confusing because it looks like the workflow is doing something on PR. Split into two workflows so the PR's check list is just \`Pre-commit Tests\`: - \`test.yml\` — pre-commit on PR + push to main - \`sync.yml\` — Sync ArgoCD on push to main only (and \`workflow_dispatch\` for manual sync) ## Test plan - [x] After merge, opening a PR shows only \`test / Pre-commit Tests\` in the check list - [x] Push to \`main\` triggers both \`test\` and \`sync\` workflows - [x] \`sync\` workflow can still be manually re-run via \`gh workflow run sync.yml\` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0f50a54 commit ef42b1b

2 files changed

Lines changed: 30 additions & 20 deletions

File tree

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,21 @@
11
---
2-
name: test-and-sync
2+
name: sync
33

44
on:
55
push:
66
branches:
77
- main
8-
pull_request:
9-
types: [opened, synchronize, reopened]
108
workflow_dispatch:
119

1210
permissions:
1311
contents: read
1412

1513
jobs:
16-
test:
17-
name: Pre-commit Tests
18-
runs-on: ubuntu-latest
19-
steps:
20-
- name: Checkout repository
21-
uses: actions/checkout@v4
22-
23-
- name: Setup Python
24-
uses: actions/setup-python@v5
25-
with:
26-
python-version: "3.12"
27-
28-
- name: pre-commit tests
29-
uses: pre-commit/action@v3.0.1
30-
3114
sync:
3215
name: Sync ArgoCD
3316
# In-cluster runner; kubectl uses its auto-mounted SA token to talk to
3417
# the API directly. The tfroot-runner image has kubectl preinstalled.
3518
runs-on: arc-tf
36-
needs: [test]
37-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
3819

3920
steps:
4021
- name: Sync ArgoCD bootstrap Applications

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: test
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
types: [opened, synchronize, reopened]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
test:
17+
name: Pre-commit Tests
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
28+
- name: pre-commit tests
29+
uses: pre-commit/action@v3.0.1

0 commit comments

Comments
 (0)