Skip to content

Commit

Permalink
ci: add GitHub Action for CI checks and associated scripts
Browse files Browse the repository at this point in the history
- Added prettier, type-check scripts to package.json
- Configured GitHub Action to run checks on push and PRs to main branch
  • Loading branch information
drichar committed Aug 10, 2023
1 parent 94681ed commit 395d6e3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Checks

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'

jobs:
checks:
name: Run Checks & Tests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup node
uses: actions/setup-node@v3
with:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run Linter
run: pnpm run lint

- name: Check Prettier
run: pnpm run prettier

- name: TypeScript Type Check
run: pnpm run type-check

- name: Run test suite
run: pnpm test

- name: Build
run: pnpm run build
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# pnpm
pnpm-lock.yaml
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"prettier": "pnpm exec prettier . --check",
"prettier:fix": "pnpm exec prettier . --write",
"type-check": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watchAll"
},
Expand Down

0 comments on commit 395d6e3

Please sign in to comment.