Skip to content

Commit

Permalink
Improved the CI Workflow (#19)
Browse files Browse the repository at this point in the history
* improved the CI
* Add lint:prettier and lint:eslint scripts
* added the detailed issues in lint.yml
* fixed the prettier issues in 2 files
  • Loading branch information
tarunsinghofficial authored Jul 8, 2024
1 parent f9e0e24 commit 6de66a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache npm install artifacts
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -23,5 +31,19 @@ jobs:
- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint
- name: Run Prettier
run: npm run lint:prettier
env:
CI: true

- name: Run ESLint
run: npm run lint:eslint
env:
CI: true

- name: Display Prettier and ESLint Issues
if: failure()
run: |
echo "Prettier and ESLint found issues in the following files:"
cat /home/runner/.npm/_logs/*.log
continue-on-error: true
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"preview": "vite preview",
"test": "vitest",
"lint": "prettier --check . && eslint .",
"lint:prettier": "prettier --check .",
"lint:eslint": "eslint .",
"format": "prettier --write ."
},
"devDependencies": {
Expand Down

0 comments on commit 6de66a5

Please sign in to comment.