From ec1324dc4b3a4297177482d22d5c2d96daf0bc93 Mon Sep 17 00:00:00 2001 From: pbanddev <202373785+PBandDev@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:39:39 -0600 Subject: [PATCH] ci: add PR workflow, run tests before version bump --- .github/workflows/ci.yaml | 39 +++++++++++++++++++++++++++ .github/workflows/publish_action.yaml | 36 ++++++++++++++++++++++--- 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c429944 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + name: Test & Build + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Typecheck + run: pnpm typecheck + + - name: Run tests + run: pnpm test + + - name: Build + run: pnpm build diff --git a/.github/workflows/publish_action.yaml b/.github/workflows/publish_action.yaml index d3c1adc..686721a 100644 --- a/.github/workflows/publish_action.yaml +++ b/.github/workflows/publish_action.yaml @@ -14,9 +14,42 @@ on: default: patch jobs: + test: + name: Test before publish + runs-on: ubuntu-latest + if: github.actor == github.repository_owner + strategy: + matrix: + node-version: [20] + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Typecheck + run: pnpm typecheck + + - name: Run tests + run: pnpm test + + - name: Build + run: pnpm build + bump-version: name: Bump version and create tag runs-on: ubuntu-latest + needs: test if: github.actor == github.repository_owner permissions: contents: write @@ -77,9 +110,6 @@ jobs: - name: Install dependencies run: pnpm install - - name: Run tests - run: pnpm test - - name: Build custom node run: pnpm build