diff --git a/.github/scripts/download-bundled/opcache-jit-ir.sh b/.github/scripts/download-bundled/opcache-jit-ir.sh new file mode 100755 index 0000000000000..b68f8df160ae8 --- /dev/null +++ b/.github/scripts/download-bundled/opcache-jit-ir.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -ex +cd "$(dirname "$0")/../../.." + +commit=5a81104e650ebd7ac24eb63d4dff67db723a5278 + +rm -rf ext/opcache/jit/ir +git clone --revision=$commit https://github.com/dstogov/ir.git ext/opcache/jit/ir + +cd ext/opcache/jit/ir + +# remove unneeded files +rm -r .git +rm -r .github +rm -r bench +rm -r examples +rm -r tests +rm -r tools +rm README.md +rm TODO +rm ir.g +rm ir_cpuinfo.c +rm ir_emit_c.c +rm ir_emit_llvm.c +rm ir_load.c +rm ir_load_llvm.c +rm ir_main.c +rm ir_mem2ssa.c + +# add extra files +git restore README diff --git a/.github/scripts/download-bundled/verify-directory-unchanged.sh b/.github/scripts/download-bundled/verify-directory-unchanged.sh new file mode 100755 index 0000000000000..1a783ab693514 --- /dev/null +++ b/.github/scripts/download-bundled/verify-directory-unchanged.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -ex +cd "$(dirname "$0")/../../.." + +cd "$1" + +# display overview of changed files +git status + +# display & detect all changes +git add . -N && git diff --cached -a --exit-code . && git diff -a --exit-code . diff --git a/.github/workflows/verify-bundled-files.yml b/.github/workflows/verify-bundled-files.yml new file mode 100644 index 0000000000000..0b615857061a4 --- /dev/null +++ b/.github/workflows/verify-bundled-files.yml @@ -0,0 +1,35 @@ +name: Verify Bundled Files + +on: + push: + pull_request: + schedule: + - cron: "0 1 * * *" + workflow_dispatch: ~ + +permissions: + contents: read + +jobs: + VERIFY_BUNDLED_FILES: + name: Verify Bundled Files + runs-on: ubuntu-22.04 + steps: + - name: git checkout + uses: actions/checkout@v5 + + - uses: dorny/paths-filter@v3 + id: changes + with: + base: master + filters: | + opcache_jit_ir: + - 'ext/opcache/jit/ir/**' + + - name: Opcache JIT IR - Download + if: ${{ !cancelled() && (steps.changes.outputs.opcache_jit_ir == 'true' || (github.event_name != 'push' && github.event_name != 'pull_request')) }} + run: .github/scripts/download-bundled/opcache-jit-ir.sh + + - name: Opcache JIT IR - Verify files + if: ${{ !cancelled() && (steps.changes.outputs.opcache_jit_ir == 'true' || (github.event_name != 'push' && github.event_name != 'pull_request')) }} + run: .github/scripts/download-bundled/verify-directory-unchanged.sh ext/opcache/jit/ir