Skip to content

Commit

Permalink
ci/cd: gains GH action to automate checks and tests (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhoffa authored Aug 9, 2024
1 parent 2282421 commit 21e425f
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
setup:
name: Install Node and Dependencies
runs-on: ubuntu-latest
outputs:
node_version: ${{ steps.node_version.outputs.node-version }}
steps:
- uses: actions/checkout@v3
- id: node_version
uses: actions/setup-node@v3
with:
node-version: '18.18.2'
cache: 'npm'
- run: npm install

unit_tests:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: '18.18.2'
- run: npm install
env:
SKIP_PREPARE: true
- run: npm run test:unit

integration_tests:
name: Run Integration Tests
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: '18.18.2'
- run: npm install
- run: npx playwright install
- run: npm run test:integration
env:
CI: true

lint:
name: Run Linting
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: '18.18.2'
- run: npm install
env:
SKIP_PREPARE: true
- name: Run Linting
run: npm run lint

type_check:
name: Run Type Checking
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: '18.18.2'
- run: npm install
env:
SKIP_PREPARE: true
- name: Run Type Checking
run: npm run check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
.vercel
/.svelte-kit
/build
/test-results

# OS
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"checkJs": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
Expand Down

0 comments on commit 21e425f

Please sign in to comment.