-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Ensure integrity of llhttp wasm files | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check: | ||
name: Check files | ||
outputs: | ||
run_job: ${{ steps.check_files.outputs.run_job }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
- name: check modified files | ||
id: check_files | ||
run: | | ||
echo "=============== list modified files ===============" | ||
git diff --name-only HEAD^ HEAD | ||
echo "========== check paths of modified files ==========" | ||
git diff --name-only HEAD^ HEAD > files.txt | ||
echo "run_job=false" > "$GITHUB_OUTPUT" | ||
while IFS= read -r file | ||
do | ||
if [[ $file == deps/llhttp/* || $file == lib/llhttp/llhttp* ]]; then | ||
echo "run_job=true" > "$GITHUB_OUTPUT" | ||
fi | ||
done < files.txt | ||
llhttp-wasm: | ||
if: needs.check.outputs.run_job == 'true' | ||
name: Check integrity of generagted wasm-files for llhttp | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build wasm of llhttp | ||
run: | | ||
npm run prebuild:wasm && | ||
npm run build:wasm | ||
- name: Integrity Check | ||
run: | | ||
git diff --quiet lib/llhttp* | ||
if [ $? -eq 0 ]; then | ||
echo "No changes in the generated wasm files." | ||
else | ||
echo "Changes detected in the generated wasm files." | ||
echo "Please run 'npm run prebuild:wasm' and 'npm run build:wasm' locally and commit the changes." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.