diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2908e64..d07e3d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,4 @@ name: CI - on: push: branches: @@ -7,7 +6,6 @@ on: pull_request: branches: - main - jobs: commitlint: runs-on: ubuntu-latest @@ -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 @@ -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 diff --git a/README.md b/README.md index e9f9230..320473c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index 060aca9..54d1d1d 100644 --- a/package.json +++ b/package.json @@ -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 .",