mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-22 18:41:16 +01:00
Use existing check-dist implementation (#618)
This commit is contained in:
parent
c9db520cf3
commit
6bbe742add
2 changed files with 8 additions and 17 deletions
14
.github/workflows/check-dist.yml
vendored
14
.github/workflows/check-dist.yml
vendored
|
@ -32,14 +32,16 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Move the committed index.js file
|
- name: Rebuild the dist/ directory
|
||||||
run: mv dist/ /tmp/
|
|
||||||
|
|
||||||
- name: Rebuild the index.js file
|
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Compare the expected and actual index.js files
|
- name: Compare the expected and actual dist/ directories
|
||||||
run: git diff --ignore-all-space dist/ /tmp/dist
|
run: |
|
||||||
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
|
echo "Detected uncommitted changes after build. See status below:"
|
||||||
|
git diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
id: diff
|
id: diff
|
||||||
|
|
||||||
# If index.js was different than expected, upload the expected version as an artifact
|
# If index.js was different than expected, upload the expected version as an artifact
|
||||||
|
|
11
.github/workflows/workflow.yml
vendored
11
.github/workflows/workflow.yml
vendored
|
@ -47,17 +47,6 @@ jobs:
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
- name: Build & Test
|
- name: Build & Test
|
||||||
run: npm run test
|
run: npm run test
|
||||||
- name: Ensure dist/ folder is up-to-date
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
npm run build
|
|
||||||
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
|
|
||||||
echo "Detected uncommitted changes after build. See status below:"
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# End to end save and restore
|
# End to end save and restore
|
||||||
test-save:
|
test-save:
|
||||||
|
|
Loading…
Reference in a new issue