Skip to content

Commit

Permalink
ci: 👷 update ci workflow
Browse files Browse the repository at this point in the history
include basic tests
  • Loading branch information
spences10 committed Aug 20, 2023
1 parent 7e42f76 commit 398854d
Show file tree
Hide file tree
Showing 10 changed files with 811 additions and 21 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Tests: E2E'
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
tests-e2e:
name: Run end-to-end tests
runs-on: ubuntu-latest

steps:
- uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: Linux-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: Linux-playwright-
- uses: actions/cache@v3
with:
path: ~/.pnpm-store
# prettier-ignore
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- uses: pnpm/[email protected]
with:
version: 6.0.2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: pnpm i
- name: Install playwright browsers
run: npx playwright install --with-deps
- name: Test
run: pnpm run test
env:
PUBLIC_FATHOM_ID: ${{ secrets.PUBLIC_FATHOM_ID }}
PUBLIC_FATHOM_URL: ${{ secrets.PUBLIC_FATHOM_URL }}
38 changes: 38 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Tests: Unit'
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest

steps:
- uses: actions/cache@v3
with:
path: ~/.pnpm-store
key:
# prettier-ignore
${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 6.0.2
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
env:
PUBLIC_FATHOM_ID: ${{ secrets.PUBLIC_FATHOM_ID }}
PUBLIC_FATHOM_URL: ${{ secrets.PUBLIC_FATHOM_URL }}
- name: Test
run: pnpm run test:ci
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@sveltejs/adapter-vercel": "3.0.3",
"@sveltejs/kit": "1.22.6",
"@tailwindcss/typography": "0.5.9",
"@testing-library/svelte": "^4.0.3",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"autoprefixer": "10.4.15",
Expand All @@ -29,6 +30,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte3": "^4.0.0",
"fathom-client": "3.5.0",
"jsdom": "^22.1.0",
"mdsvex": "0.11.0",
"postcss": "8.4.28",
"postcss-load-config": "4.0.1",
Expand Down
7 changes: 4 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import type { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
},
command: 'pnpm run build && pnpm run preview',
port: 4173,
timeout: 3 * 60 * 1000,
},
testDir: 'tests',
}

Expand Down
Loading

1 comment on commit 398854d

@vercel
Copy link

@vercel vercel bot commented on 398854d Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cv – ./

cv-git-main-spences10.vercel.app
cv-spences10.vercel.app
mecv.xyz
www.mecv.xyz

Please sign in to comment.