Skip to content

Commit

Permalink
Adding lint-and-test workflow to dispatch on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeLo123 committed Apr 5, 2024
1 parent 5fc8e87 commit e2af429
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint and Test

on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check Linter
run: yarn lint:check
- name: Check Formatting
run: yarn format:check

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
run: yarn test
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
npm test
yarn test

npx lint-staged
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"*.{ts,tsx}": "eslint --cache --fix",
"*.{js,css,md,ts,tsx,yml}": "prettier --write"
}
}
}

0 comments on commit e2af429

Please sign in to comment.