Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the CI Workflow #19

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading