Fix test workflow error on Ubuntu #3
This file contains hidden or 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
| name: Test | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| jobs: | ||
| test: | ||
| name: Test on ${{ matrix.os }} using Node.js v${{ matrix.node }} | ||
| continue-on-error: true | ||
| strategy: | ||
| matrix: | ||
| os: [windows-latest, macos-latest, ubuntu-latest] | ||
| # This should also include Node.js v20, but snapshot testing is only | ||
| # available in Node.js v22.3 or later. | ||
| node: [22, 24] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| package-manager-cache: false | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: latest | ||
| run_install: true | ||
| # Prevent `No usable sandbox!` error on Ubuntu. See: | ||
| # https://github.com/puppeteer/puppeteer/issues/13595 | ||
| - name: Disable AppArmor | ||
| if: ${{ matrix.os == ubuntu-latest }} | ||
| run: | ||
| echo 0 | sudo tee | ||
| /proc/sys/kernel/apparmor_restrict_unprivileged_userns | ||
| - name: Run tests | ||
| run: pnpm test | ||