ci: add PR workflow, run tests before version bump

This commit is contained in:
pbanddev
2026-01-08 06:39:39 -06:00
parent 7dd0eb5472
commit ec1324dc4b
2 changed files with 72 additions and 3 deletions
+39
View File
@@ -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
+33 -3
View File
@@ -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