-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] install + configure Vitest - [x] install + configure Playwright - [x] configure GH actions - [x] write basic component tests fror SlipmatButton - [x] write basic e2e tests for SlipmatButton - [x] configure automatic NPM publishing - [x] update CHANGELOG - [x] bump version Fixes slipmatio/slipmatio#82
- Loading branch information
Showing
18 changed files
with
1,034 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: E2E Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/e2e.yml' | ||
- 'pnpm-lock.yaml' | ||
- 'src/**/*.ts' | ||
- 'src/**/*.vue' | ||
- 'tests/e2e/**/*.spec.ts' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/e2e.yml' | ||
- 'pnpm-lock.yaml' | ||
- 'src/**/*.ts' | ||
- 'src/**/*.vue' | ||
- 'tests/e2e/**/*.spec.ts' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: e2e-${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
e2e-tests: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DEBUG: 0 | ||
PLAYWRIGHT_BROWSERS_PATH: 0 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/.local/share/pnpm/store | ||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
|
||
- name: Install Playwright browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run e2e tests | ||
run: pnpm test:ci-e2e | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: test-results/ | ||
retention-days: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- run: | | ||
pnpm i --frozen-lockfile | ||
pnpm build | ||
- uses: JS-DevTools/npm-publish@v2 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build + Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/test.yml' | ||
- 'pnpm-lock.yaml' | ||
- 'src/**/*.ts' | ||
- 'src/**/*.vue' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/test.yml' | ||
- 'pnpm-lock.yaml' | ||
- 'src/**/*.ts' | ||
- 'src/**/*.vue' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: test-${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
DEBUG: 0 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
# - name: Install playwright browsers | ||
# run: pnpm i | ||
# working-directory: front | ||
|
||
- name: Build front | ||
run: pnpm build | ||
|
||
- name: Test front | ||
run: pnpm coverage | ||
|
||
- name: Component Coverage | ||
uses: davelosert/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
working-directory: ./ | ||
vite-config-path: ./vite.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,6 @@ pnpm-debug.log* | |
*.sln | ||
*.sw? | ||
|
||
test-results | ||
|
||
LOCAL_NOTES.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ pnpm dev | |
pnpm build | ||
``` | ||
|
||
#### TBA: Run end-to-end tests | ||
#### Run end-to-end tests | ||
|
||
``` | ||
pnpm test:e2e | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import type { PlaywrightTestConfig } from '@playwright/test' | ||
import { devices } from '@playwright/test' | ||
|
||
const config: PlaywrightTestConfig = { | ||
testDir: './tests/e2e', | ||
timeout: 15 * 1000, | ||
expect: { | ||
/** | ||
* Maximum time expect() should wait for the condition to be met. | ||
* For example in `await expect(locator).toHaveText();` | ||
*/ | ||
timeout: 3000, | ||
}, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: process.env.CI ? 1 : 0, | ||
/* Opt out of parallel tests on CI. */ | ||
workers: process.env.CI ? 2 : undefined, | ||
use: { | ||
actionTimeout: 0, | ||
baseURL: 'http://localhost:5173', | ||
trace: 'on-first-retry', | ||
// headless: !!process.env.CI, | ||
}, | ||
webServer: { | ||
command: 'vite dev', | ||
port: 5173, | ||
reuseExistingServer: !process.env.CI, | ||
}, | ||
projects: [ | ||
{ | ||
name: 'iPhone 6', | ||
use: { | ||
browserName: 'webkit', | ||
...devices['iPhone 6'], | ||
}, | ||
}, | ||
{ | ||
name: 'Macbook 11', | ||
use: { | ||
browserName: 'firefox', | ||
...devices['Macbook 11'], | ||
video: 'on-first-retry', | ||
}, | ||
}, | ||
{ | ||
name: 'Desktop', | ||
use: { | ||
browserName: 'chromium', | ||
...devices['Macbook Pro'], | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
export default config |
Oops, something went wrong.