Enforce Worker's compiled code to be up-to-date
@@ -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:
