From ff7bd2a88bc2fc0a73e81b8cbe65f3524329009a Mon Sep 17 00:00:00 2001 From: moscowchill Date: Wed, 4 Nov 2026 09:39:56 +0100 Subject: [PATCH] ci: test each change once, on its pull request Every commit on a branch with an open pull request ran twice, once for the push and once for the pull request: 26 of the last 40 runs were pushes. - Pull requests into dev and main run the suite, plus a weekly run on dev and manual dispatch. - Job timeout, superseded pull request runs cancelled, actions pinned by commit at current majors. --- .github/workflows/test.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 510d544..8e17378 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,23 +2,39 @@ name: CI permissions: {} +# Each change is tested once, on its pull request. Pushes to a branch with an open +# pull request used to run everything twice. The weekly run surfaces drift in the +# registry. on: - push: pull_request: + branches: [dev, main] + schedule: + - cron: '0 3 * * 1' workflow_dispatch: +# The weekly run tests dev, where changes land first. Scheduled runs read this +# file from main. +env: + TEST_REF: ${{ github.event_name == 'schedule' && 'dev' || '' }} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: javascript: name: Contract tooling and frontend runs-on: ubuntu-latest + timeout-minutes: 8 permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + ref: ${{ env.TEST_REF }} persist-credentials: false - - uses: actions/setup-node@v4 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 22.22.x cache: npm