Skip to content

Commit

Permalink
Update GHA for pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bulychev committed May 7, 2024
1 parent 3c66849 commit f07a325
Show file tree
Hide file tree
Showing 22 changed files with 1,325 additions and 1,601 deletions.
25 changes: 18 additions & 7 deletions .github/actions/run-qunit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,27 @@ runs:
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
- name: Get pnpm store directory
shell: bash
run: npm install --no-audit --no-fund
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install

- name: Download artifacts
uses: actions/download-artifact@v3
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/default_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,37 @@ jobs:
name: main
runs-on: devextreme-shr2
timeout-minutes: 15

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 }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Run npm install
run: npm ci --no-audit --no-fund

- name: Run targets
run: >
npx nx run-many
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/demos_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,27 @@ 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 }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Run unit tests
working-directory: apps/demos
run: npm run test
run: pnpm run test
56 changes: 39 additions & 17 deletions .github/workflows/demos_visual_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,29 @@ 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 }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: 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 +84,31 @@ jobs:
with:
node-version: '20'

- name: Restore npm cache
uses: actions/cache@v4
- 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: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: DevExtreme - Install packages
run: npm install --no-audit --no-fund
- name: Install dependencies
run: 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 +133,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: npm run test-testcafe
run: pnpm run test-testcafe

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

0 comments on commit f07a325

Please sign in to comment.