diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 0000000..af8148c --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,12 @@ +name: Install + +description: Install this app + +runs: + using: composite + steps: + - 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..e8b087f 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -37,9 +37,6 @@ jobs: 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..8e4959c 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: @@ -15,10 +11,6 @@ jobs: 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"