Skip to content

Commit

Permalink
chore: ghcr.io/pmndrs/playwright image
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Jul 17, 2024
1 parent 4f0eae9 commit 2a14767
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
main:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.45.2-jammy
image: ghcr.io/pmndrs/playwright:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5087,7 +5087,9 @@ Makes an object's shadow respect its opacity and alphaMap.
To run visual tests in the same environment as the CI:

```sh
$ docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/playwright:v1.45.2-jammy yarn test
$ docker run --init --rm -v $(pwd):/app -w /app ghcr.io/pmndrs/playwright:main yarn test
```

NB: if running on mac m-series, you'll probably want to add `--platform linux/arm64` to the docker command.

</details>
15 changes: 7 additions & 8 deletions test/e2e/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ set -ex

PORT=5188
DIST=../../dist
PID_FILE=/tmp/drei-e2e.pid

(cd $DIST; npm pack)
TGZ=$(realpath "$DIST/react-three-drei-0.0.0-semantic-release.tgz")

kill_app() {
kill $(cat $PID_FILE)
kill -9 $(lsof -ti:$PORT) || echo "ok, no previous running process on port $PORT"
}

cleanup() {
kill_app || true
kill_app
}
cleanup
trap cleanup EXIT
cleanup || true
trap cleanup EXIT INT TERM HUP

tmp=$(mktemp -d)

Expand All @@ -42,7 +41,7 @@ appdir="$tmp/$appname"
cp App.jsx $appdir/src/App.jsx

# build+start+jest
(cd $appdir; npm run build; npm run preview -- --host --port $PORT & echo $! > $PID_FILE)
(cd $appdir; npm run build; npm run preview -- --host --port $PORT &)
npx playwright test snapshot.test.js
kill_app

Expand All @@ -68,7 +67,7 @@ appdir="$tmp/$appname"
cp App.jsx $appdir/app/page.js

# build+start+jest
(cd $appdir; npm run build; npm start -- -p $PORT & echo $! > $PID_FILE)
(cd $appdir; npm run build; npm start -- -p $PORT &)
npx playwright test snapshot.test.js
kill_app

Expand All @@ -94,7 +93,7 @@ appdir="$tmp/$appname"
cp App.jsx $appdir/src/App.js

# build+start+jest
(cd $appdir; npm run build; npx serve -s -p $PORT build & echo $! > $PID_FILE)
(cd $appdir; npm run build; npx serve -s -p $PORT build &)
npx playwright test snapshot.test.js
kill_app

Expand Down

0 comments on commit 2a14767

Please sign in to comment.