-
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.
Merge pull request #1 from magurotuna/simplify
Playwright fails to run with Deno on Ubuntu
- Loading branch information
Showing
3 changed files
with
7 additions
and
54 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 |
---|---|---|
|
@@ -7,6 +7,8 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 0 * * *' # Run every day | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -15,6 +17,7 @@ jobs: | |
matrix: | ||
browser: [chromium, firefox] | ||
os: [ubuntu-latest, macos-latest] | ||
deno-version: [1.46.3, 2.0.0-rc.6, canary, 2.0.0] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
@@ -25,38 +28,12 @@ jobs: | |
|
||
- name: Install Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{ matrix.deno-version }} | ||
|
||
- name: Install ${{ matrix.browser }} | ||
run: deno run -A npm:[email protected] install --with-deps ${{ matrix.browser }} | ||
|
||
- name: Run | ||
working-directory: ./deno | ||
run: deno task ${{ matrix.browser }} | ||
|
||
node: | ||
strategy: | ||
matrix: | ||
browser: [chromium, firefox] | ||
os: [ubuntu-latest, macos-latest] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
|
||
- name: npm ci | ||
working-directory: ./node | ||
run: npm ci | ||
|
||
- name: Install Playwright Browser | ||
working-directory: ./node | ||
run: npx playwright install --with-deps ${{ matrix.browser }} | ||
|
||
- name: Run | ||
working-directory: ./node | ||
run: node index.mjs ${{ matrix.browser }} |
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,22 +1,9 @@ | ||
import { chromium } from "npm:[email protected]"; | ||
|
||
async function main() { | ||
await using browser = await chromium.launch({ | ||
await using _browser = await chromium.launch({ | ||
headless: true, | ||
args: [ | ||
"--no-sandbox", | ||
//"--headless=new", | ||
"--disable-dev-shm-usage", | ||
"--disable-setuid-sandbox", | ||
"--disable-gpu", | ||
"--no-xshm", | ||
"--disable-features=VizDisplayCompositor", | ||
], | ||
}); | ||
await using page = await browser.newPage(); | ||
await page.goto("https://example.com"); | ||
const title = await page.title(); | ||
console.log(`title: ${title}`); | ||
} | ||
|
||
if (import.meta.main) { | ||
|
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,20 +1,9 @@ | ||
import { firefox } from "npm:[email protected]"; | ||
|
||
async function main() { | ||
await using browser = await firefox.launch({ | ||
await using _browser = await firefox.launch({ | ||
headless: true, | ||
args: [ | ||
"--no-sandbox", | ||
], | ||
firefoxUserPrefs: { | ||
"gfx.webrender.all": false, | ||
"media.hardware-video-decoding.enabled": false, | ||
}, | ||
}); | ||
await using page = await browser.newPage(); | ||
await page.goto("https://example.com"); | ||
const title = await page.title(); | ||
console.log(`title: ${title}`); | ||
} | ||
|
||
if (import.meta.main) { | ||
|