Skip to content

Commit

Permalink
chore: use test runner for installation tests (#9110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf-2 authored Oct 14, 2022
1 parent 6a05d8e commit 8f4902e
Show file tree
Hide file tree
Showing 28 changed files with 2,081 additions and 490 deletions.
51 changes: 30 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ jobs:
- name: Run all tests
run: xvfb-run --auto-servernum npm run test -- --test-suite ${{ matrix.suite }}

pack-packages:
name: Pack packages
installation-test-build:
name: Build installation test
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -206,44 +206,53 @@ jobs:
node-version: latest
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build libraries
run: npm run build
- name: Pack libraries
run: npm pack --workspaces
- name: Upload packages
- name: Build installation test
run: npm run build --workspace @puppeteer-test/installation
- name: Pack installation test
run: npm pack --workspace @puppeteer-test/installation
- name: Upload installation test
uses: actions/upload-artifact@v3
with:
name: packages
path: ./*.tgz
name: installation-test
path: puppeteer-test-installation-latest.tgz

install-tests:
name: Test installation on ${{ matrix.os }} (${{ matrix.node }})
needs: pack-packages
installation-test:
name: Test ${{ matrix.pkg_manager }} installation on ${{ matrix.os }} (${{ matrix.node }})
needs: installation-test-build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- 14
- 16
- 18
pkg_manager:
- npm
- yarn
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download installation test
uses: actions/download-artifact@v3
with:
name: installation-test
- name: Unpack installation test
run: tar -xf puppeteer-test-installation-latest.tgz --strip-components 1 -C .
- name: Set up Node.js
uses: actions/[email protected]
with:
cache: npm
node-version: ${{ matrix.node }}
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages
- name: Test bundling and installation
run: npm run test-install
- name: Set up ${{ matrix.pkg_manager }}
run: npm install -g ${{ matrix.pkg_manager }}@latest
- name: Install dependencies
run: ${{ matrix.pkg_manager }} install
- name: Test
env:
PKG_MANAGER: ${{ matrix.pkg_manager }}
run: ${{ matrix.pkg_manager }} test

docker-tests:
name: Test Docker image
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ yarn-error.log*
## [END] Keep in sync with .gitignore

# Prettier-only ignores.
assets/
CHANGELOG.md
package-lock.json
test/assets/
Expand Down
Loading

0 comments on commit 8f4902e

Please sign in to comment.