diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..faa370e --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,18 @@ +name: Setup TypeScript workspace +description: Install pnpm and Node.js, then install the locked dependencies. + +runs: + using: composite + steps: + - name: Setup pnpm + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 + + - name: Setup Node.js + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + with: + node-version: 22.23.3 + cache: pnpm + + - name: Install dependencies + shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69e7f32..f7135d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,17 +33,8 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - - - name: Setup Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: 22.23.3 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup workspace + uses: ./.github/actions/setup # zizmor: ignore[self-repository] - name: Run oxlint run: pnpm run lint @@ -59,17 +50,8 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - - - name: Setup Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: 22.23.3 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup workspace + uses: ./.github/actions/setup # zizmor: ignore[self-repository] - name: Run oxfmt run: pnpm run format:check @@ -85,17 +67,8 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - - - name: Setup Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: 22.23.3 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup workspace + uses: ./.github/actions/setup # zizmor: ignore[self-repository] - name: Run typecheck run: pnpm run typecheck @@ -111,17 +84,8 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - - - name: Setup Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: 22.23.3 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup workspace + uses: ./.github/actions/setup # zizmor: ignore[self-repository] - name: Run tests run: pnpm run test @@ -137,17 +101,8 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 - - - name: Setup Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: 22.23.3 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup workspace + uses: ./.github/actions/setup # zizmor: ignore[self-repository] - name: Run knip run: pnpm run knip