From 1dd7d1ba0914f9bb83fcc181128543e18486f3f6 Mon Sep 17 00:00:00 2001 From: John Wright Date: Tue, 18 Aug 2026 21:30:42 +0100 Subject: [PATCH 1/2] ci: abstract installation --- .github/actions/install/action.yml | 13 +++++++++++++ .github/workflows/npm-publish.yml | 6 +----- .github/workflows/test.yml | 15 +++------------ package.json | 1 + 4 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 .github/actions/install/action.yml diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 0000000..0869d93 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,13 @@ +name: Install + +description: Install this app + +runs: + using: composite + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .nvmrc + - shell: bash + run: npm ci diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index a9b5659..e60bdc8 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -36,10 +36,6 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v7 - - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - run: npm ci + - uses: ./.github/actions/install - run: npm run build - run: npm publish --provenance --access public diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1064208..5b86f30 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,10 +2,6 @@ name: Test on: workflow_call: - inputs: - ref: - required: false - type: string jobs: test: @@ -14,11 +10,6 @@ jobs: matrix: node-version: [22, 24, 26] steps: - - uses: actions/checkout@v7 - with: - ref: ${{ inputs.ref || '' }} - - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npx tsc --noEmit && npm test + - uses: ./.github/actions/install + - run: npm run check + - run: npm test diff --git a/package.json b/package.json index 8339e68..7d64e01 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "scripts": { "build": "npm run clean && tsc", + "check": "tsc --noEmit", "clean": "rimraf dist", "prepare": "husky install", "test": "tsc --project test/tsconfig.json" From e0f6c97e0e3a3e72028c76e80d5954c45eced7a5 Mon Sep 17 00:00:00 2001 From: John Wright Date: Tue, 18 Aug 2026 21:36:13 +0100 Subject: [PATCH 2/2] ci: checkout before install --- .github/actions/install/action.yml | 1 - .github/workflows/npm-publish.yml | 1 + .github/workflows/test.yml | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 0869d93..af8148c 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -5,7 +5,6 @@ description: Install this app runs: using: composite steps: - - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version-file: .nvmrc diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index e60bdc8..e8b087f 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -36,6 +36,7 @@ jobs: contents: read id-token: write steps: + - uses: actions/checkout@v7 - uses: ./.github/actions/install - run: npm run build - run: npm publish --provenance --access public diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b86f30..8e4959c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,7 @@ jobs: matrix: node-version: [22, 24, 26] steps: + - uses: actions/checkout@v7 - uses: ./.github/actions/install - run: npm run check - run: npm test