chore(docker): upgrade to NPM 7 (#8915)

This commit is contained in:
Max Schmitt 2021-09-22 16:38:50 +02:00 committed by GitHub
parent 018467911b
commit 5b93df0bab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View file

@ -7,13 +7,13 @@ on:
- release-*
paths:
- '.github/workflows/tests_docker.yml'
- '**/Dockerfile'
- '**/Dockerfile*'
- 'browsers.json'
- 'package.json'
pull_request:
paths:
- '.github/workflows/tests_docker.yml'
- '**/Dockerfile'
- '**/Dockerfile*'
- 'browsers.json'
- 'package.json'
branches:
@ -47,16 +47,19 @@ jobs:
run: |
npm run clean
rm -rf node_modules/
# The whole folder has to be world-writable to avoid UID conflicts between this mount and docker.
chmod -R 777 .
if [[ ${{ matrix.user }} == 'root' ]]; then
sudo chown -R 0 $(pwd)
else
sudo chown -R 1000 $(pwd)
fi
- name: Launch container
run: docker run --rm -v $(pwd):/tmp/playwright --name playwright-docker-${{matrix.tag}}-test -d -t playwright:localbuild-${{ matrix.tag }} /bin/bash
run: docker run --rm --user=${{ matrix.user }} -v $(pwd):/tmp/playwright --workdir /tmp/playwright/ --name playwright-docker-${{ matrix.tag }}-test -d -t playwright:localbuild-${{ matrix.tag }} /bin/bash
- name: Run "npm ci" inside docker
run: docker exec --workdir /tmp/playwright/ --user=${{ matrix.user }} playwright-docker-${{matrix.tag}}-test npm ci
run: docker exec playwright-docker-${{ matrix.tag }}-test npm ci
- name: Run "npm run build" inside docker
run: docker exec --workdir /tmp/playwright/ --user=${{ matrix.user }} playwright-docker-${{matrix.tag}}-test npm run build
run: docker exec playwright-docker-${{ matrix.tag }}-test npm run build
- name: Run "npm run test" inside docker
run: docker exec --workdir /tmp/playwright/ --user=${{ matrix.user }} -e INSIDE_DOCKER=1 -e CI=1 playwright-docker-${{matrix.tag}}-test xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" npm run test
run: docker exec -e INSIDE_DOCKER=1 -e CI=1 playwright-docker-${{ matrix.tag }}-test xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" npm run test
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always()
- uses: actions/upload-artifact@v1

View file

@ -7,6 +7,9 @@ RUN apt-get update && apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# Upgrade to NPM7 (see https://github.com/microsoft/playwright/pull/8915)
RUN npm install -g npm@7
# Feature-parity with node.js base images.
RUN apt-get update && apt-get install -y --no-install-recommends git ssh && \
npm install -g yarn

View file

@ -7,6 +7,9 @@ RUN apt-get update && apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# Upgrade to NPM7 (see https://github.com/microsoft/playwright/pull/8915)
RUN npm install -g npm@7
# Feature-parity with node.js base images.
RUN apt-get update && apt-get install -y --no-install-recommends git ssh && \
npm install -g yarn