Skip to content

Commit d28479d

Browse files
Fix build for webkit (#27)
1 parent 88e95ab commit d28479d

File tree

5 files changed

+19
-48
lines changed

5 files changed

+19
-48
lines changed

.github/workflows/buildAndDeploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- master
7-
workflow_dispatch: {}
7+
workflow_dispatch: { }
88

99
jobs:
1010
build_and_deploy:
@@ -13,6 +13,9 @@ jobs:
1313
group: build-and-deploy
1414
cancel-in-progress: true
1515
runs-on: ubuntu-24.04
16+
env:
17+
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
18+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
1619
steps:
1720
- uses: actions/checkout@v3
1821

@@ -43,7 +46,7 @@ jobs:
4346
run: npx playwright install --with-deps
4447

4548
- name: Run e2e tests
46-
run: npm run test:e2e
49+
run: PLAYWRIGHT_USE_BUILD=1 npm run test:e2e
4750

4851
- name: Deploy
4952
uses: peaceiris/actions-gh-pages@v3

.github/workflows/checkPullRequests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Check Pull Requests"
22

33
on:
44
pull_request:
5-
types: ["opened", "edited", "reopened", "synchronize"]
5+
types: [ "opened", "edited", "reopened", "synchronize" ]
66

77
jobs:
88
check_pull_request:
@@ -11,6 +11,9 @@ jobs:
1111
group: ${{ github.head_ref }}
1212
cancel-in-progress: true
1313
runs-on: ubuntu-24.04
14+
env:
15+
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
16+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
1417
steps:
1518
- uses: actions/checkout@v3
1619

@@ -38,4 +41,4 @@ jobs:
3841
run: npx playwright install --with-deps
3942

4043
- name: Run e2e tests
41-
run: PLAYWRIGHT_DEV_SERVER=1 npm run test:e2e
44+
run: npm run test:e2e

.github/workflows/makeArtifactWithTestScreenshots.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
make_artifact_with_test_screenshots:
77
name: Make artifact with Test Screenshots
88
runs-on: ubuntu-24.04
9+
env:
10+
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
11+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
912
steps:
1013
- uses: actions/checkout@v3
1114

@@ -20,8 +23,8 @@ jobs:
2023
- name: Install Playwright Browsers
2124
run: npx playwright install --with-deps
2225

23-
- name: Run e2e tests
24-
run: PLAYWRIGHT_DEV_SERVER=1 npm run test:e2e:update-snapshots
26+
- name: Run e2e tests with snapshots update
27+
run: npm run test:e2e:update-snapshots
2528

2629
- name: Upload test screenshots
2730
uses: actions/upload-artifact@v4

playwright.config.ts

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import type { PlaywrightTestConfig } from "@playwright/test";
22
import { devices } from "@playwright/test";
33

4-
/**
5-
* Read environment variables from file.
6-
* https://github.com/motdotla/dotenv
7-
*/
8-
// require('dotenv').config();
4+
const useExistedBuild = !!process.env.PLAYWRIGHT_USE_BUILD;
95

106
/**
117
* See https://playwright.dev/docs/test-configuration.
@@ -63,52 +59,18 @@ const config: PlaywrightTestConfig = {
6359
...devices["Desktop Safari"],
6460
},
6561
},
66-
67-
/* Test against mobile viewports. */
68-
// {
69-
// name: 'Mobile Chrome',
70-
// use: {
71-
// ...devices['Pixel 5'],
72-
// },
73-
// },
74-
// {
75-
// name: 'Mobile Safari',
76-
// use: {
77-
// ...devices['iPhone 12'],
78-
// },
79-
// },
80-
81-
/* Test against branded browsers. */
82-
// {
83-
// name: 'Microsoft Edge',
84-
// use: {
85-
// channel: 'msedge',
86-
// },
87-
// },
88-
// {
89-
// name: 'Google Chrome',
90-
// use: {
91-
// channel: 'chrome',
92-
// },
93-
// },
9462
],
9563

96-
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
97-
// outputDir: 'test-results/',
98-
9964
/* Run your local dev server before starting the tests */
10065
webServer: {
10166
/**
10267
* Use the dev server by default for faster feedback loop.
10368
* Use the preview server on CI for more realistic testing.
10469
Playwright will re-use the local server if there is already a dev-server running.
10570
*/
106-
command:
107-
process.env.CI && !process.env.PLAYWRIGHT_DEV_SERVER
108-
? "vite preview --port 5173"
109-
: "vite dev",
71+
command: useExistedBuild ? "vite preview --port 5173" : "vite dev",
11072
port: 5173,
111-
reuseExistingServer: !process.env.CI || !!process.env.PLAYWRIGHT_DEV_SERVER,
73+
reuseExistingServer: useExistedBuild,
11274
},
11375
};
11476

vite.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
outlierSupport: ["vue"],
1414
},
1515
policy: {
16-
"style-src": ["'unsafe-inline'"], // todo remove when naive-ui will be fixed
16+
"style-src": ["'self'", "'unsafe-inline'"], // todo remove when naive-ui will be fixed
1717
"style-src-elem": ["'unsafe-inline'"], // todo remove when naive-ui will be fixed
1818
"img-src": ["data:", "blob:"],
1919
"script-src": ["'wasm-unsafe-eval'"],

0 commit comments

Comments
 (0)