Skip to content

Commit

Permalink
fix(github-action): fix commitlint job and fix test related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
231tr0n committed Mar 3, 2024
1 parent 4a958d3 commit c693e69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: CI

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

jobs:
commitlint:
runs-on: ubuntu-latest
Expand All @@ -17,7 +15,8 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: latest
node-version: lts/*
check-latest: true
- name: Print versions
run: |
git --version
Expand All @@ -26,7 +25,6 @@ jobs:
- name: Install dependencies
run: npm install
- name: Commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Lint
run: npm run lint
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ npm run format
npm run lint
```

### Test

```bash
npm run test
```

### Important points to note when contributing.

- Github action will fail in the following scenarios
1. Eslint linting error
2. Prettier formatting error
3. Build error
4. Commit message not following [conventional commiting format](https://conventionalcommits.org).
4. Test error
5. Commit message not following [conventional commiting format](https://conventionalcommits.org)
- In the event of failure of the github action, go to its logs and check which job has failed and what is the error printed so that it can be debugged and resolved.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"devtest": "vitest --watch",
"test:watch": "vitest --watch",
"test": "vitest --run --coverage",
"lint": "prettier --check . && eslint .",
"format": "prettier --check --write .",
Expand Down

0 comments on commit c693e69

Please sign in to comment.