From ad3a44601ed861a7a82235b5e44adf3fd4b861f2 Mon Sep 17 00:00:00 2001 From: Mwale Kalenga Date: Fri, 15 May 2026 14:54:14 +0200 Subject: [PATCH 1/2] Add post-build smoke E2E against built .zip artifact Runs the @smoke-tagged activation suite against the packaged plugin zip in CI, after build_package_release and before publishing the release. - Tag activation.spec.js describe with @smoke so the bootstrap CLI picks it up via Playwright's --grep. - Bump @gravitykit/e2e-bootstrap to ^1.1.0 (smoke CLI subcommand). - Persist .release and the gf-entries-in-excel-*.zip glob from build_package_release so downstream jobs can install the built artifact. - Add run_post_build_smoke job: unzips the artifact, restores dev deps through gktools' Docker composer (PHP 7.4), boots wp-env, runs the smoke spec against the built plugin. - Extract Create GitHub release + Announce build into a publish_release job gated on smoke success; release publishing now only happens when the built artifact actually activates cleanly. --- .circleci/config.yml | 65 ++++++++++++++++++++++++++---- package-lock.json | 11 +++-- package.json | 2 +- tests/E2E/tests/activation.spec.js | 2 +- 4 files changed, 66 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c164167..aa252a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,6 +118,55 @@ jobs: else echo "Skipping translation pipeline." fi + - run: + name: Collect build artifacts + command: | + mkdir -p .release + cp gf-entries-in-excel-*.zip .release/ 2>/dev/null || true + - store_artifacts: + path: .release + destination: release + - persist_to_workspace: + root: /home/circleci + paths: + - plugin/.release + - plugin/gf-entries-in-excel-*.zip + + run_post_build_smoke: + <<: *default_job_config + working_directory: /home/circleci/plugin + machine: + image: default + docker_layer_caching: true + resource_class: xlarge + steps: + - attach_workspace: + at: /home/circleci + - run: + name: Post-build smoke + # Unzips .release/*.zip, restores dev deps via gktools' Docker composer, + # boots wp-env with retry, runs `playwright test --grep=@smoke` against + # the built artifact. See @gravitykit/e2e-bootstrap README for details. + command: | + npx @gravitykit/e2e-bootstrap smoke \ + --composer-cmd "npx @gravitykit/gktools composer install" + - store_artifacts: + path: tests/E2E/results + - store_artifacts: + path: tests/E2E/report + - store_test_results: + path: tests/E2E/results/junit.xml + + publish_release: + <<: *default_job_config + steps: + - attach_workspace: + at: /home/circleci + - run: + name: Configure git + command: | + git config user.email "support@gravitykit.com" + git config user.name "GravityKit - CI" - run: name: Create GitHub release command: npx @gravitykit/gktools release @@ -127,14 +176,6 @@ jobs: if ! git log -1 --pretty=%B | grep -iq "\[skip notify\]"; then npx @gravitykit/gktools announce fi - - run: - name: Collect build artifacts - command: | - mkdir -p .release - cp gf-entries-in-excel-*.zip .release/ 2>/dev/null || true - - store_artifacts: - path: .release - destination: release workflows: version: 2 @@ -148,3 +189,11 @@ workflows: <<: *context requires: - prepare + - run_post_build_smoke: + <<: *context + requires: + - build_package_release + - publish_release: + <<: *context + requires: + - run_post_build_smoke diff --git a/package-lock.json b/package-lock.json index 834f96e..435a8ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "GPL-2.0", "devDependencies": { - "@gravitykit/e2e-bootstrap": "^1.0.0", + "@gravitykit/e2e-bootstrap": "^1.1.0", "@playwright/test": "1.56.1", "@wordpress/env": "^10.0.0", "grunt": "^1.5.3", @@ -18,15 +18,18 @@ } }, "node_modules/@gravitykit/e2e-bootstrap": { - "version": "1.0.0", - "resolved": "https://npm.pkg.github.com/download/@gravitykit/e2e-bootstrap/1.0.0/4f5bef34f2b159367dbc43bbb46e02e1de39f579", - "integrity": "sha512-fSsX3g5iLy3p6UuuV8qsihqlqdq6LsxkcmQGRC90xd3s85Ve1GwSkC766XmvWIGHtTTZBP0WwJmgykrLJTSAfw==", + "version": "1.1.0", + "resolved": "https://npm.pkg.github.com/download/@gravitykit/e2e-bootstrap/1.1.0/d14bcc5d6e2b8e4a37e0ae43497895a41710473c", + "integrity": "sha512-TCUlswVxxcOI7ItXeO/3eXZyJhLzxZk9hYuekZW/GdU+Arf1GPbn6Pj1DGbGU9Cgg7rmDf9Qrl9Xas6nf7FNWQ==", "dev": true, "license": "MIT", "dependencies": { "@gravitykit/e2e-fixtures": "^1.2.0", "dotenv": "^16.4.5" }, + "bin": { + "e2e-bootstrap": "bin/cli.js" + }, "peerDependencies": { "@playwright/test": ">=1.56.0", "@wordpress/env": ">=10.0.0" diff --git a/package.json b/package.json index 2ad45d7..ce61341 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "tests:e2e:run": "playwright test --config=tests/E2E/setup/playwright.config.js" }, "devDependencies": { - "@gravitykit/e2e-bootstrap": "^1.0.0", + "@gravitykit/e2e-bootstrap": "^1.1.0", "@playwright/test": "1.56.1", "@wordpress/env": "^10.0.0", "grunt": "^1.5.3", diff --git a/tests/E2E/tests/activation.spec.js b/tests/E2E/tests/activation.spec.js index bead7b7..e8d2d66 100644 --- a/tests/E2E/tests/activation.spec.js +++ b/tests/E2E/tests/activation.spec.js @@ -1,6 +1,6 @@ const { test, expect } = require('@playwright/test'); -test.describe('GravityExport Lite — Activation Smoke Test', () => { +test.describe('GravityExport Lite — Activation Smoke Test @smoke', () => { test('Plugin activates without fatal PHP errors', async ({ page } ) => { await page.goto('/wp-admin/plugins.php'); From 154e40cde8cb032ae41605c4a65fd01ebd61f405 Mon Sep 17 00:00:00 2001 From: Mwale Kalenga Date: Fri, 15 May 2026 15:11:04 +0200 Subject: [PATCH 2/2] Address CodeRabbit review on .circleci/config.yml - Remove '2>/dev/null || true' from 'cp gf-entries-in-excel-*.zip .release/' so the step fails loudly when the build produced no zip, instead of swallowing the cp error and surfacing the problem later. - Drop the redundant 'working_directory: /home/circleci/plugin' from run_post_build_smoke. The default_job_config anchor already sets it; the duplicate was a copy-paste artifact from the prompt template. --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa252a3..a6977ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,7 +122,7 @@ jobs: name: Collect build artifacts command: | mkdir -p .release - cp gf-entries-in-excel-*.zip .release/ 2>/dev/null || true + cp gf-entries-in-excel-*.zip .release/ - store_artifacts: path: .release destination: release @@ -134,7 +134,6 @@ jobs: run_post_build_smoke: <<: *default_job_config - working_directory: /home/circleci/plugin machine: image: default docker_layer_caching: true