Skip to content

Commit

Permalink
ci: added basic code quality checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Slartibartfass2 committed Nov 9, 2024
1 parent a14210f commit b9bf9fe
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/code_quality_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Code Quality Checks

on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:

env:
node_version: ${{ vars.NODE_VERSION }}

jobs:
linting:
name: Linting with Prettier and ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Install dependencies
run: npm install

- name: Run Prettier & ESLint
run: npm run lint

unit-test:
name: Unit Testing with Vitest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Install dependencies
run: npm install

- name: Run Vitest
run: npm run test:unit

e2e-test:
name: End-to-End Testing with Playwright
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Install dependencies
run: npm install

- name: Install Playwright
run: npx playwright install --with-deps

- name: Run Playwright
run: npm run test:e2e
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"test:unit": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:unit": "vitest run",
"test": "npm run test:unit && npm run test:e2e",
"test:e2e": "playwright test"
},
"devDependencies": {
Expand Down

0 comments on commit b9bf9fe

Please sign in to comment.