From 787b75d63aeaa159d87080cb9bd1572853bcd8d1 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 11 Nov 2026 03:20:15 +0300 Subject: [PATCH 1/4] ci: test on Node 26 and pin runners to ubuntu-24.04 - Add Node 26 (current LTS) to the unit test matrix - Pin runs-on to ubuntu-24.04 instead of ubuntu-latest to avoid unplanned runner image migrations - Update the Node matrix mentioned in tests/README.md Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish-to-npm.yml | 4 ++-- .github/workflows/tests.yml | 6 +++--- tests/README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml index 2034fdf..3e1f909 100644 --- a/.github/workflows/publish-to-npm.yml +++ b/.github/workflows/publish-to-npm.yml @@ -7,7 +7,7 @@ on: jobs: publish: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: write steps: @@ -30,7 +30,7 @@ jobs: changelog: needs: publish - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: write steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 360da34..04be74b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,12 +12,12 @@ on: jobs: unit: name: Unit (Node ${{ matrix.node-version }}) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: # Matches engines.node: ">=18" in package.json - node-version: [18, 20, 22, 24] + node-version: [18, 20, 22, 24, 26] steps: - uses: actions/checkout@v4 @@ -55,7 +55,7 @@ jobs: # checks. GitHub does not expose repository secrets to pull requests from # forks, so those runs fail at the explicit secret check below instead of # producing a false-green result. - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/tests/README.md b/tests/README.md index de11a5d..38c4c1f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -414,7 +414,7 @@ The configuration is [.github/workflows/tests.yml](../.github/workflows/tests.ym ### Why the jobs are split -- **Unit tests are the mandatory blocking step.** Deterministic, no network, no secrets, a couple of seconds. Safe on any PR, forks included. They run on a Node `18 / 20 / 22` matrix, matching `engines.node: ">=18"`. +- **Unit tests are the mandatory blocking step.** Deterministic, no network, no secrets, a couple of seconds. Safe on any PR, forks included. They run on a Node `18 / 20 / 22 / 24 / 26` matrix, matching `engines.node: ">=18"`. - **Integration tests deliberately do not run on pull requests.** They spend real account balance and depend on an external API being up. More importantly, secrets are unavailable in a PR from a fork, so the tests would skip themselves and produce a **false green** instead of an honest "not checked". ### What the nightly run actually checks From 4d464b4285bbbb5d55f2893719db1ec87475eff7 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 11 Nov 2026 03:22:58 +0300 Subject: [PATCH 2/4] ci: publish to npm on Node 24 Node 20 has reached end of life. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish-to-npm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml index 3e1f909..2a273c6 100644 --- a/.github/workflows/publish-to-npm.yml +++ b/.github/workflows/publish-to-npm.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '24' registry-url: 'https://registry.npmjs.org' cache: npm - run: npm ci From 5e55484a6b5a73a5c4c56224fb65bfb6b42c44d5 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 11 Nov 2026 03:22:59 +0300 Subject: [PATCH 3/4] docs: document integration tests running on pull requests Since 109ea51 the integration job runs on push to main and on pull requests, not only on schedule and manual dispatch. Co-Authored-By: Claude Opus 5.5 --- tests/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/README.md b/tests/README.md index 38c4c1f..1d2f316 100644 --- a/tests/README.md +++ b/tests/README.md @@ -410,18 +410,18 @@ The configuration is [.github/workflows/tests.yml](../.github/workflows/tests.ym | Job | Command | When it runs | Secrets | |---|---|---|---| | `unit` | `npm run test:unit -- --coverage` | push to `main`, any pull request, schedule, manual dispatch | none | -| `integration` | `npm run test:integration` | **only** on schedule (daily at 03:00 UTC) and manually via workflow_dispatch | `CAPTCHA_API_KEY` | +| `integration` | `npm run test:integration` | push to `main`, any pull request, schedule (daily at 03:00 UTC), manual dispatch | `CAPTCHA_API_KEY` | ### Why the jobs are split - **Unit tests are the mandatory blocking step.** Deterministic, no network, no secrets, a couple of seconds. Safe on any PR, forks included. They run on a Node `18 / 20 / 22 / 24 / 26` matrix, matching `engines.node: ">=18"`. -- **Integration tests deliberately do not run on pull requests.** They spend real account balance and depend on an external API being up. More importantly, secrets are unavailable in a PR from a fork, so the tests would skip themselves and produce a **false green** instead of an honest "not checked". +- **Integration tests also run on pull requests**, so a change that breaks the real API flow is caught before merge. The cost is real account balance on every run and a dependency on the external API being up. Secrets are unavailable in a PR from a fork, so there the job **fails** at the fail-early step (see below) instead of skipping the tests and producing a false green. ### What the nightly run actually checks The `integration` job passes only `CAPTCHA_API_KEY` to the tests. It has no target variables, so among the paid suites everything skips except the three image-based ones — `image_to_text.test.js`, `coordinates.test.js` and `yandex_smartcaptcha_image.test.js`: they need no targets, and with a live key they **really do hit the API and spend balance**. `recaptcha_v2.test.js` used to work off a hard-coded Google demo page; after targets were dropped from the repository (see [above](#why-the-repository-carries-no-targets)) that is no longer the case. -So **every night costs two tasks**, one per image. That is the price of the nightly run checking `solve()` at all, rather than the balance alone, which is all it used to check. If that spend is unwanted, the simplest fix is to narrow the step to specific files: `npm test -- tests/integration/balance.test.js`. +So **every run costs two tasks**, one per image - nightly, on every push to `main` and on every push to a pull request. That is the price of CI checking `solve()` at all, rather than the balance alone, which is all it used to check. If that spend is unwanted, the simplest fix is to narrow the step to specific files: `npm test -- tests/integration/balance.test.js`. The remaining target-driven solve tests are not planned for CI yet. When they are wanted, the order is: From 42b513365c0a9fec337b1a0d4f382493ceb8ec6e Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 11 Nov 2026 03:24:12 +0300 Subject: [PATCH 4/4] docs: drop npm publishing from missing pipeline features Publishing is handled by publish-to-npm.yml. Co-Authored-By: Claude Opus 5.5 --- tests/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 1d2f316..70bbd6f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -450,5 +450,4 @@ Without it a missing key would look like a successful run: the tests skip themse ### What the pipeline does not have yet - A lint step — no linter is configured in the project. -- Publishing to npm. - Badges in the README — tracked in [todo.md](../todo.md) together with wiring up Coveralls (which needs action in a web UI).