79
79
uses : actions/setup-node@v2
80
80
with :
81
81
node-version : 18.x
82
- - name : Install Chrome
83
- uses : browser-actions/setup-chrome@latest
84
- with :
85
- chrome-version : stable
86
82
- name : Cache dependencies
87
83
id : cache-dependencies
88
84
uses : actions/cache@v2
@@ -91,22 +87,28 @@ jobs:
91
87
key : node-modules-${{ hashFiles('package-lock.json') }}
92
88
restore-keys : |
93
89
node-modules-
90
+ - name : Install dependencies
91
+ run : npm install
92
+ - name : Install Chrome
93
+ uses : browser-actions/setup-chrome@latest
94
+ with :
95
+ chrome-version : stable
94
96
- name : Run tests
95
97
env :
96
98
CHROME_HEADLESS : 1
97
99
CHROME_PATH : chrome
98
100
CHROME_FLAGS : " --headless --disable-gpu --no-sandbox --enable-features=SharedArrayBuffer,CrossOriginIsolation"
99
- HEADERS : ' {"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp","Cross-Origin-Resource-Policy":"cross-origin","Origin-Agent-Cluster":"?1 "}'
101
+ HEADERS : ' {"Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp"}'
100
102
run : |
101
- # Start test server with proper headers
102
- npm run serve -- --headers "${ HEADERS} " &
103
+ # Start test server with proper headers for all tests
104
+ npm run serve -- --headers "$HEADERS" &
103
105
104
106
# Increase wait time to ensure server is ready
105
107
sleep 15
106
108
107
109
# Verify headers and isolation status
108
110
echo "Checking security headers and isolation status..."
109
- curl -I http://localhost:3000/tests/ffmpeg-core-st.test.html
111
+ curl -v http://localhost:3000/tests/ffmpeg-core-st.test.html 2>&1 | grep -i "cross-origin"
110
112
111
113
# Run verification script first
112
114
echo "Verifying browser environment..."
@@ -162,18 +164,18 @@ jobs:
162
164
# Run the verification in Chrome
163
165
echo "Verifying browser environment..."
164
166
npx mocha-headless-chrome \
165
- --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation --disable-web-security --allow-insecure-localhost " \
167
+ --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
166
168
-a no-sandbox \
167
169
-f http://localhost:3000/verify-browser.html
168
170
169
171
# Run MT tests with verified configuration
170
172
npx mocha-headless-chrome \
171
- --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation --disable-web-security --allow-insecure-localhost " \
173
+ --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
172
174
-a no-sandbox \
173
175
-f http://localhost:3000/tests/ffmpeg-core-mt.test.html 2>&1 | tee mt-core-test.log
174
176
175
177
npx mocha-headless-chrome \
176
- --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation --disable-web-security --allow-insecure-localhost " \
178
+ --args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
177
179
-a no-sandbox \
178
180
-f http://localhost:3000/tests/ffmpeg-mt.test.html 2>&1 | tee mt-test.log
179
181
0 commit comments