Skip to content

Commit

Permalink
Migrate package manager: NPM -> PNPM (#27614)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Bulychev <[email protected]>
Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
iBat and Alexander Bulychev authored Jul 15, 2024
1 parent d9f2762 commit 3fc409b
Show file tree
Hide file tree
Showing 2,488 changed files with 47,607 additions and 78,507 deletions.
35 changes: 24 additions & 11 deletions .github/actions/run-qunit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ runs:
with:
node-version: '20'

- name: Restore npm cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules

- name: Run npm install
shell: bash
run: npm install --no-audit --no-fund

- name: Download artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -104,6 +93,30 @@ runs:
rm -rf artifacts/npm
7z x artifacts.zip
- uses: pnpm/action-setup@v3
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: |
${{ env.STORE_PATH }}
.nx/cache
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install dependencies
shell: bash
run: pnpm install

- name: Build dotnet
working-directory: ./packages/devextreme
shell: bash
Expand Down
42 changes: 31 additions & 11 deletions .github/workflows/default_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,44 @@ jobs:
name: main
runs-on: devextreme-shr2
timeout-minutes: 30

steps:
- name: Get sources
uses: actions/checkout@v4

- name: Restore npm cache
uses: actions/cache@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- uses: pnpm/action-setup@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: |
${{ env.STORE_PATH }}
.nx/cache
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install dependencies
run: |
corepack enable
pnpm install
- name: Run npm install
run: npm ci --no-audit --no-fund

- name: Run targets
run: >
npx nx run-many
pnpx nx run-many
-t test
--exclude
devextreme
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/demos_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,31 @@ jobs:
with:
node-version: '20'

- name: Restore npm cache
uses: actions/cache@v4
- uses: pnpm/action-setup@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
version: 9
run_install: false

- name: Run npm install
run: npm install --no-audit --no-fund
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: |
${{ env.STORE_PATH }}
.nx/cache
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install dependencies
run: |
corepack enable
pnpm install
- name: Run unit tests
working-directory: apps/demos
run: npx nx test
run: pnpx nx test
67 changes: 48 additions & 19 deletions .github/workflows/demos_visual_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_TOKEN }}
NX_SKIP_NX_CACHE: ${{ (github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'skip-cache')) && 'true' || 'false' }}
BUILD_TEST_INTERNAL_PACKAGE: true

jobs:
build:
Expand All @@ -30,18 +31,33 @@ jobs:
with:
node-version: '20'

- name: Restore npm cache
uses: actions/cache@v4
- uses: pnpm/action-setup@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
version: 9
run_install: false

- name: DevExtreme - Install packages
run: npm install --no-audit --no-fund
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: |
${{ env.STORE_PATH }}
.nx/cache
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install dependencies
run: |
corepack enable
pnpm install
- name: DevExtreme - Build
run: npx nx build devextreme-main
run: pnpx nx build devextreme-main

testcafe:
needs:
Expand Down Expand Up @@ -73,20 +89,33 @@ jobs:
with:
node-version: '20'

- name: Restore npm cache
uses: actions/cache@v4
- uses: pnpm/action-setup@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: DevExtreme - Install packages
run: npm install --no-audit --no-fund
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: |
${{ env.STORE_PATH }}
.nx/cache
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install dependencies
run: |
corepack enable
pnpm install
- name: DevExtreme - Build
env:
BUILD_TEST_INTERNAL_PACKAGE: true
run: npx nx build devextreme-main
run: pnpx nx build devextreme-main

- name: Run Web Server
run: |
Expand All @@ -111,7 +140,7 @@ jobs:
# DISABLE_DEMO_TEST_SETTINGS: ignore # Uncomment to ignore the `ignore` field
# DISABLE_DEMO_TEST_SETTINGS: comparison-options # Uncomment to ignore the `comparison-options` field
CI_ENV: true # The `ignore` field in the visualtestrc.json should be disabled when running test locally
run: npx nx test-testcafe
run: pnpx nx test-testcafe

- name: Show accessibility warnings
if: matrix.STRATEGY == 'accessibility'
Expand Down
Loading

0 comments on commit 3fc409b

Please sign in to comment.