Skip to content

Commit 3575faf

Browse files
committed
python-wheels workflows: add sync self-check job
Add sync-self-check job that fails if emu/pub workflows diverge beyond the expected differences (name, cisco-actions/* mirrors).
1 parent c6b92ac commit 3575faf

2 files changed

Lines changed: 46 additions & 12 deletions

File tree

.github/workflows/emu-python-wheels.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# ┌─────────────────────────────────────────────────────────────────┐
2-
# IMPORTANT: This file MUST stay in sync with
3-
# pub-python-wheels.yml. The only expected differences are the
4-
# workflow name and the cisco-actions/* mirror references.
5-
# Do NOT accept PRs where these files diverge in any other way.
6-
# └─────────────────────────────────────────────────────────────────┘
1+
###################################################################
2+
# IMPORTANT: This file MUST stay in sync with
3+
# pub-python-wheels.yml. The only expected differences are the
4+
# workflow name and the cisco-actions/* mirror references.
5+
# Do NOT accept PRs where these files diverge in any other way.
6+
###################################################################
77
name: "[EMU] Python Wheels"
88

99
on:
@@ -13,7 +13,24 @@ on:
1313
- main
1414

1515
jobs:
16+
sync-self-check:
17+
name: Sync self-check
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
- name: Check diff between emu and pub workflow files
22+
run: |
23+
MAX_DIFF_LINES=4
24+
COUNT=$(diff -y --suppress-common-lines .github/workflows/emu-python-wheels.yml .github/workflows/pub-python-wheels.yml | wc -l)
25+
echo "Differing lines: $COUNT (max allowed: $MAX_DIFF_LINES)"
26+
if [ "$COUNT" -gt "$MAX_DIFF_LINES" ]; then
27+
echo "::error::emu-python-wheels.yml and pub-python-wheels.yml have diverged ($COUNT differing lines, max $MAX_DIFF_LINES)"
28+
diff .github/workflows/emu-python-wheels.yml .github/workflows/pub-python-wheels.yml || true
29+
exit 1
30+
fi
31+
1632
build-mercury-wheels:
33+
needs: sync-self-check
1734
name: Build wheels on ${{ matrix.os }}
1835
runs-on: ${{ matrix.os }}
1936
environment:

.github/workflows/pub-python-wheels.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# ┌─────────────────────────────────────────────────────────────────┐
2-
# IMPORTANT: This file MUST stay in sync with
3-
# emu-python-wheels.yml. The only expected differences are the
4-
# workflow name and the cisco-actions/* mirror references.
5-
# Do NOT accept PRs where these files diverge in any other way.
6-
# └─────────────────────────────────────────────────────────────────┘
1+
###################################################################
2+
# IMPORTANT: This file MUST stay in sync with
3+
# emu-python-wheels.yml. The only expected differences are the
4+
# workflow name and the cisco-actions/* mirror references.
5+
# Do NOT accept PRs where these files diverge in any other way.
6+
###################################################################
77
name: "[PUB] Python Wheels"
88

99
on:
@@ -13,7 +13,24 @@ on:
1313
- main
1414

1515
jobs:
16+
sync-self-check:
17+
name: Sync self-check
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
- name: Check diff between emu and pub workflow files
22+
run: |
23+
MAX_DIFF_LINES=4
24+
COUNT=$(diff -y --suppress-common-lines .github/workflows/emu-python-wheels.yml .github/workflows/pub-python-wheels.yml | wc -l)
25+
echo "Differing lines: $COUNT (max allowed: $MAX_DIFF_LINES)"
26+
if [ "$COUNT" -gt "$MAX_DIFF_LINES" ]; then
27+
echo "::error::emu-python-wheels.yml and pub-python-wheels.yml have diverged ($COUNT differing lines, max $MAX_DIFF_LINES)"
28+
diff .github/workflows/emu-python-wheels.yml .github/workflows/pub-python-wheels.yml || true
29+
exit 1
30+
fi
31+
1632
build-mercury-wheels:
33+
needs: sync-self-check
1734
name: Build wheels on ${{ matrix.os }}
1835
runs-on: ${{ matrix.os }}
1936
environment:

0 commit comments

Comments
 (0)