Skip to content

Commit 1f287e2

Browse files
committed
Install git-lfs in the Playwright image for proper functionality
1 parent aa8705d commit 1f287e2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/verify.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,25 @@ jobs:
4646
runs-on: ubuntu-latest
4747
container:
4848
image: mcr.microsoft.com/playwright:v1.57.0-noble
49-
options: --user 1001
49+
options: --user 0 # Run as root to allow installation of git-lfs
5050
defaults:
5151
run:
5252
working-directory: ./spock-website
5353
steps:
54+
# Unlike the default image, the playwright image does not have git-lfs installed
55+
- name: Install git-lfs and switch to non-root user
56+
run: |
57+
apt-get update
58+
apt-get install -y git-lfs
59+
echo "Fixing permissions for non-root user and switching user"
60+
chown -R 1001:1001 .
61+
pwd
62+
ls -al
63+
su - $(id -un 1001)
64+
pwd
65+
ls -al
66+
working-directory: ./ # the default only exists after checkout
67+
5468
- name: Checkout
5569
uses: actions/checkout@v6
5670
with:
@@ -68,6 +82,8 @@ jobs:
6882

6983
- name: Run Playwright Tests
7084
run: npx playwright test
85+
env:
86+
HOME: /root # Firefox is unable to launch if the $HOME folder isn't owned by the current user. This is a workaround for running in a container.
7187

7288
- name: Upload Test Results (optional)
7389
uses: actions/upload-artifact@v5

0 commit comments

Comments
 (0)