Skip to content

Commit

Permalink
ci: run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giuxtaposition committed Dec 22, 2023
1 parent 5c54094 commit a97b0f1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 21
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Run unit tests
run: pnpm test
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Build extension and run e2e tests
run: pnpm build-and-test-e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"pack:crx": "crx pack dist -o ./extension.crx",
"pack:xpi": "WEB_EXT_ARTIFACTS_DIR=./ web-ext build --source-dir ./dist --filename extension.xpi --overwrite-dest",
"pack:zip": "rimraf extension.zip && jszip-cli add dist/* -o ./extension.zip",
"test": "ENVIRONMENT=test vitest",
"test": "ENVIRONMENT=test vitest run",
"coverage": "ENVIRONMENT=test vitest run --coverage",
"test:e2e": "playwright test",
"test:e2e:ui": "MODE=UI pnpm run test:e2e --ui",
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default defineConfig(({ mode }) => {
globals: true,
environment: "jsdom",
setupFiles: "./src/tests/setup.ts",
include: ["./src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
},
};
});

0 comments on commit a97b0f1

Please sign in to comment.