Skip to content

Commit

Permalink
feat: add ci pipeline (#13)
Browse files Browse the repository at this point in the history
* feat: install prettier

* feat: add github actions ci pipeline

* feat: add pre-commit hook

* fix: prettier warnings

* fix: add .eslintcache to gitignore

* fix: separate ci jobs

* fix: update ci.yml

* revert: go back to singe job with multi-steps
  • Loading branch information
detarkende authored Aug 20, 2024
1 parent 64eaf99 commit 85fc7f7
Show file tree
Hide file tree
Showing 10 changed files with 924 additions and 142 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI
on:
push:
branches: ['master']
pull_request:
branches: ['master']
jobs:
build:
name:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout code
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: npm install
- name: Check types
run: npm run typecheck
- name: Check formatting with Prettier
run: npm run check-formatting
- name: Lint with ESLint
run: npm run lint
- name: Run unit tests
run: npm run test
- name: Run build
run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ state.json
test-downloads
config.json
.vscode/schemas/config.schema.json
.eslintcache

dist
.env
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
16 changes: 8 additions & 8 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": true,
"printWidth": 100
"arrowParens": "always",
"bracketSpacing": true,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": true,
"printWidth": 100
}
Loading

0 comments on commit 85fc7f7

Please sign in to comment.