From cd0ec55a3b07d0cbdcaec854d00c25c7dd147508 Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Fri, 7 Mar 2025 09:16:16 -0500 Subject: [PATCH] Fix issue #44: Add CI workflow and update Husky configuration --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .husky/pre-commit | 1 - .husky/pre-push | 4 ++++ .nvmrc | 1 + package.json | 5 +++-- 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100755 .husky/pre-push create mode 100644 .nvmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c59faf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: + - '*' + pull_request: + branches: + - main + +env: + PNPM_VERSION: 10.2.1 + NODE_VERSION: 18 + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + with: + version: ${{ env.PNPM_VERSION }} + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint + run: pnpm lint + + - name: Build + run: pnpm build + + - name: TypeCheck + run: pnpm typecheck \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index 23cd53b..a21987e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" echo "Running pre-commit checks..." pnpm pre-commit-check diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000..52d22b6 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +echo "Running pre-push checks..." +pnpm pre-commit-check \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..25bf17f --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18 \ No newline at end of file diff --git a/package.json b/package.json index e24bd1b..4a2ad7c 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "eslint --fix" + "eslint --fix", + "git add" ] } -} \ No newline at end of file +}