Enforce Worker's compiled code to be up-to-date

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
ItalyPaleAle 2022-12-19 17:55:26 +00:00
parent 135d460b05
commit 45ab96d3d7
1 changed files with 23 additions and 0 deletions

View File

@ -175,6 +175,10 @@ jobs:
conformance:
name: ${{ matrix.component }} conformance
runs-on: ubuntu-latest
env:
# Version of Node.js to use
# Currently used by the Cloudflare components
NODE_VERSION: 18.x
defaults:
run:
shell: bash
@ -320,6 +324,25 @@ jobs:
run: docker-compose -f ./.github/infrastructure/docker-compose-rabbitmq.yml -p rabbitmq up -d
if: contains(matrix.component, 'rabbitmq')
- name: Install Node.js ${{ env.NODE_VERSION }}
if: contains(matrix.component, 'cloudflare')
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Check Cloudflare Workers code
if: contains(matrix.component, 'cloudflare')
run: |
# Build the Worker
(
cd internal/component/cloudflare/worker-src;
npm ci;
npm run build;
)
# Check no changes
git diff --exit-code ./internal/component/cloudflare/workers/code \
|| (echo "The source code of the Cloudflare Worker has changed, but the Worker has not been recompiled. Please re-compile the Worker by running 'npm ci && npm run build' in 'internal/component/cloudflare/worker-src'" && exit 1)
- name: Setup Cloudflare KV
if: matrix.component == 'state.cloudflare.workerskv'
env: