test: add regression coverage for @paypal/paypal-js sdk-v6 subpath (issue #599) #1496
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '!*' | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| test: | |
| name: Test on node ${{ matrix.node }} and ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| env: | |
| COREPACK_DEFAULT_TO_LATEST: '0' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| node: [20, 22, 24, 26] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write # to be able to publish a GitHub release | |
| issues: write # to be able to comment on released issues | |
| pull-requests: write # to be able to comment on released pull requests | |
| id-token: write # required for npm trusted publishing (OIDC) | |
| services: | |
| redis: | |
| # See workaround https://github.com/actions/runner/issues/822#issuecomment-1524826092 | |
| image: ${{ (matrix.os == 'ubuntu-latest') && 'redis:6.0.20' || '' }} | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - uses: actions/setup-python@v6 | |
| with: | |
| # we lock to 3.11 for a distutils requirement for node-gyp | |
| python-version: '3.11' | |
| - name: Enable Corepack | |
| run: corepack enable pnpm | |
| - name: Remove PhantomJS on Node.js 26 | |
| if: matrix.node == 26 | |
| shell: bash | |
| run: | | |
| node <<'EOF' | |
| const fs = require('fs'); | |
| const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
| delete packageJson.devDependencies['phantomjs-prebuilt']; | |
| fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2) + '\n'); | |
| EOF | |
| - name: Install Dependencies | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.node }}" = "26" ]; then | |
| pnpm install --frozen-lockfile=false | |
| else | |
| pnpm install --frozen-lockfile | |
| fi | |
| - name: Prettier | |
| if: matrix.os == 'ubuntu-latest' | |
| run: pnpm prettier-check | |
| - name: Build | |
| run: pnpm build | |
| - name: Run Tests | |
| env: | |
| BULL_REDIS_CONNECTION: ${{ (matrix.os == 'ubuntu-latest') && 'redis://127.0.0.1:6379/0' || '' }} | |
| run: pnpm ${{ (matrix.os == 'ubuntu-latest') && 'test-verbose' || 'test' }} | |
| - name: Maybe Release | |
| if: matrix.os == 'ubuntu-latest' && matrix.node == 24 && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COREPACK_ENABLE_STRICT: '0' | |
| run: pnpm --dir publish install --ignore-workspace --frozen-lockfile && ./publish/node_modules/.bin/semantic-release |