Skip to content

Commit 8334c9a

Browse files
author
Development
committed
ci: add PR workflow and check task for continuous quality
- Create PR workflow that runs on pull requests - Add 'mise run check' task combining typecheck, lint (optional), and tests - Workflow uses mise for tool management and pnpm caching - Runs typecheck and tests on every PR to catch issues early - Note: Some existing tests have validation issues to be fixed
1 parent af192a1 commit 8334c9a

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/pr.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
pull-requests: read
17+
18+
jobs:
19+
Checks:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: jdx/mise-action@bfb9fa0b029db830a8c570757cee683df207a6c5 # v2.4.0
27+
with:
28+
experimental: true
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Get pnpm store directory
32+
id: pnpm-cache
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
36+
37+
- name: Setup pnpm cache
38+
uses: actions/cache@v3
39+
with:
40+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
44+
45+
- name: Install dependencies
46+
run: pnpm install --frozen-lockfile
47+
48+
- name: Run checks
49+
run: mise run check

.mise/tasks/check

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
#MISE description="Run typecheck, lint, and tests"
3+
#MISE depends=["setup"]
4+
5+
set -euo pipefail
6+
7+
echo "🔍 Running checks..."
8+
echo ""
9+
10+
# TypeCheck
11+
echo "📝 TypeCheck..."
12+
tsc -noEmit
13+
echo "✅ TypeCheck passed"
14+
echo ""
15+
16+
# Lint
17+
echo "🎨 Linting..."
18+
if [ -f ".eslintrc.json" ] || [ -f ".eslintrc.js" ] || [ -f ".eslintrc.yml" ]; then
19+
eslint src --ext .ts,.tsx
20+
echo "✅ Linting passed"
21+
else
22+
echo "⚠️ ESLint config not found, skipping"
23+
fi
24+
echo ""
25+
26+
# Tests
27+
echo "🧪 Running tests..."
28+
vitest run
29+
echo "✅ Tests passed"
30+
echo ""
31+
32+
echo "✅ All checks passed!"

0 commit comments

Comments
 (0)