Skip to content

Commit

Permalink
read pnpm version from package.json and update node.js in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Aug 4, 2023
1 parent 41441c0 commit 82da63c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
12 changes: 7 additions & 5 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,27 @@ runs:
steps:
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7.12.1

- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: ${{ inputs.node-version }}
cache: pnpm

- name: Configure corepack
if: ${{ inputs.enable-corepack == 'true' }}
- name: Upgrade corepack
if: ${{ inputs.enable-corepack == 'true' && inputs.node-version == '16' }}
shell: bash
# Forcibly upgrade our available version of corepack.
# The bundled version in node 16 has known issues.
# Prepends the npm bin dir so that it is always first.
run: |
npm install --force --global corepack@latest
npm config get prefix >> $GITHUB_PATH
corepack enable
- name: Configure corepack
if: ${{ inputs.enable-corepack == 'true' }}
shell: bash
run: corepack enable

- name: pnpm install
id: install
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/nextjs-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ env:
RUST_BACKTRACE: 0
NEXT_TELEMETRY_DISABLED: 1
TEST_CONCURRENCY: 6
# pnpm version should match to what upstream next.js uses
PNPM_VERSION: 7.24.3
DATADOG_API_KEY: ${{ secrets.DD_KEY_TURBOPACK }}
DATADOG_TRACE_NEXTJS_TEST: "true"
DD_ENV: "ci"
Expand Down Expand Up @@ -72,11 +70,15 @@ jobs:
path: ./*
key: ${{ inputs.version }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt}}-${{ github.run_number }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
run: |
corepack enable
corepack prepare --activate [email protected]
- name: Run test/development
run: |
ls $NEXT_TEST_SKIP_RETRY_MANIFEST
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
NEXT_TEST_MODE=dev node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/(development|e2e|unit)|packages\/.*\/src\/.*)/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
Expand All @@ -85,6 +87,7 @@ jobs:
env:
# marker to parse log output, do not delete / change.
NEXT_INTEGRATION_TEST: true

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -109,16 +112,21 @@ jobs:
path: ./*
key: ${{ inputs.version }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
run: |
corepack enable
corepack prepare --activate [email protected]
- name: Run test/production
run: |
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
NEXT_TEST_MODE=start node run-tests.js -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/(production|e2e))/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
continue-on-error: true
env:
NEXT_INTEGRATION_TEST: true

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -143,16 +151,21 @@ jobs:
path: ./*
key: ${{ inputs.version }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
run: |
corepack enable
corepack prepare --activate [email protected]
- name: Run test/integration
run: |
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
node run-tests.js -g ${{ matrix.group }}/12 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/integration)/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
continue-on-error: true
env:
NEXT_INTEGRATION_TEST: true

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/setup-nextjs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
runs-on: ubuntu-latest-16-core-oss
outputs:
output1: ${{ steps.build-next-swc-turbopack-patch.outputs.success }}
env:
# pnpm version should match to what upstream next.js uses
PNPM_VERSION: 7.24.3
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
Expand Down Expand Up @@ -76,7 +73,7 @@ jobs:
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.16.1/hyperfine_1.16.1_amd64.deb
sudo dpkg -i hyperfine_1.16.1_amd64.deb
npm i -g pnpm@$PNPM_VERSION && pnpm --version
corepack enable
pnpm install --loglevel error
- name: Build next-swc with latest turbopack
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ jobs:
# work out of box. We should take another stab at it later.
- name: Setup Pnpm
uses: pnpm/[email protected]
with:
version: 7.2.1

- name: Make sure pnpm always has a cache
shell: bash
Expand Down Expand Up @@ -845,9 +843,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
# TODO: update to Node 18. Currently fails because the node-canvas dependency doesn't compile for node 18
# Did not spend too much time investigating so it could be an easy fix.
node-version: 16
node-version: 18

- name: Build benchmarks for tests
timeout-minutes: 120
Expand Down Expand Up @@ -912,9 +908,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
# TODO: update to Node 18. Currently fails because the node-canvas dependency doesn't compile for node 18
# Did not spend too much time investigating so it could be an easy fix.
node-version: 16
node-version: 18

- name: Build benchmarks for tests
timeout-minutes: 120
Expand Down

0 comments on commit 82da63c

Please sign in to comment.