Skip to content

Commit 0064420

Browse files
committed
minor #2503 [CI] Fix and display changed dist files in the CI (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [CI] Fix and display changed dist files in the CI | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> When working on https://github.com/symfony/stimulus-bridge, I've added a new job CI that shows when dist files are up-to-date or need to be build. No surprise, I re-used what was on UX, but I found it was not correct: https://github.com/symfony/stimulus-bridge/actions/runs/12743300005/job/35512968204?pr=96 <img width="993" alt="image" src="https://github.com/user-attachments/assets/564c5a93-3aed-4fca-abee-32fd01ec72d2" /> The command that checks if files are up-to-date fails, to me it is not working as expected. Instead, I've simplified things and added a `git diff` to display the changes: <img width="1017" alt="image" src="https://github.com/user-attachments/assets/666112e3-5247-4331-8c8a-edec57b3a9aa" /> WDYT? Commits ------- 59a6efc [CI] Fix and display changed dist files in the CI
2 parents ed474d2 + 59a6efc commit 0064420

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

.github/workflows/test.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,17 @@ jobs:
4747
restore-keys: |
4848
${{ runner.os }}-yarn-
4949
- run: yarn --immutable && yarn build
50-
- name: Check if js dist files are current
51-
id: changes
52-
run: |
53-
echo "STATUS=$(git status --porcelain)" >> $GITHUB_OUTPUT
5450

55-
- name: No changes found
56-
if: steps.changes.outputs.STATUS == ''
57-
run: |
58-
echo "git status is clean"
59-
- name: Changes were found
60-
if: steps.changes.outputs.STATUS != ''
51+
- name: Check if JS dist files are current
6152
run: |
62-
echo "JS dist files need to be rebuilt"
63-
echo "${{ steps.changes.outputs.STATUS }}"
64-
exit 1
53+
if [[ -n $(git status --porcelain) ]]; then
54+
echo "The Git workspace is unclean! Changes detected:"
55+
git status --porcelain
56+
git diff
57+
exit 1
58+
else
59+
echo "The Git workspace is clean. No changes detected."
60+
fi
6561
6662
tests-php-components:
6763
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)