-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ add
e2e
tests Github Actions worflow
- Loading branch information
1 parent
64b0fd1
commit 39c2a95
Showing
7 changed files
with
70 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: preview | ||
|
||
on: [deployment_status] | ||
|
||
jobs: | ||
e2e: | ||
if: github.event.deployment_status.state == 'success' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 🏗 Setup Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 📦 Install | ||
uses: ./.github/actions/install | ||
with: | ||
node-version: 20 | ||
pnpm-version: 8.10.5 | ||
|
||
- name: 📦 Install Playwright Deps | ||
run: pnpm exec playwright install --with-deps | ||
|
||
- name: ✅ e2e | ||
run: pnpm e2e | ||
env: | ||
BASE_URL: ${{ github.event.deployment_status.environment_url }} |
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 |
---|---|---|
|
@@ -40,3 +40,6 @@ storybook-static | |
|
||
# eslint | ||
.eslintcache | ||
|
||
# env | ||
.env* |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,36 @@ | ||
import path from 'node:path' | ||
|
||
import react from '@vitejs/plugin-react-swc' | ||
import { defineConfig } from 'vite' | ||
import { defineConfig, loadEnv } from 'vite' | ||
import { configDefaults } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
plugins: [react()], | ||
resolve: { alias: { '@': path.resolve(__dirname, './src') } }, | ||
test: { | ||
coverage: { | ||
reporter: ['html', 'text-summary'], | ||
exclude: [ | ||
'**/*.d.ts', | ||
'storybook-static/**', | ||
'.storybook/**', | ||
'**/*.stories.*', | ||
'**/main.tsx', | ||
'{tailwind,postcss,playwright}.config.*', | ||
'.{eslint,prettier}rc.{?(c|m)js,yml}', | ||
'node_modules/.pnpm/**', | ||
], | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), '') | ||
|
||
return { | ||
plugins: [react()], | ||
resolve: { alias: { '@': path.resolve(__dirname, './src') } }, | ||
server: { | ||
port: parseInt(env.PORT), | ||
}, | ||
test: { | ||
coverage: { | ||
reporter: ['html', 'text-summary'], | ||
exclude: [ | ||
'**/*.d.ts', | ||
'storybook-static/**', | ||
'.storybook/**', | ||
'**/*.stories.*', | ||
'**/main.tsx', | ||
'{tailwind,postcss,playwright}.config.*', | ||
'.{eslint,prettier}rc.{?(c|m)js,yml}', | ||
'node_modules/.pnpm/**', | ||
], | ||
}, | ||
environment: 'happy-dom', | ||
exclude: [...configDefaults.exclude, 'e2e/*'], | ||
globals: true, | ||
setupFiles: './src/test/setup.ts', | ||
}, | ||
environment: 'happy-dom', | ||
exclude: [...configDefaults.exclude, 'e2e/*'], | ||
globals: true, | ||
setupFiles: './src/test/setup.ts', | ||
}, | ||
} | ||
}) |
39c2a95
There was a problem hiding this comment.
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:
react-starter – ./
react-starter-git-main-jimmy-codes.vercel.app
react-starter-plum.vercel.app
react-starter-jimmy-codes.vercel.app