Skip to content

Commit

Permalink
Fix building for monorepo (#25082)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
iBat authored Jul 13, 2023
1 parent d6238a6 commit a99816b
Show file tree
Hide file tree
Showing 73 changed files with 28,520 additions and 1,026 deletions.
72 changes: 36 additions & 36 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
# General d.ts files

*.d.ts @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/ts/** @DevExpress/devextreme-apireviewers
/packages/devextreme/ts/** @DevExpress/devextreme-apireviewers

# Localization strings

/js/localization/messages/** @DevExpress/devextreme-techwriters
/packages/devextreme/js/localization/messages/** @DevExpress/devextreme-techwriters

# Grids

## grid_core

/js/__internal/grids/** @DevExpress/devextreme-grids
/js/ui/grid_core/** @DevExpress/devextreme-grids
/js/ui/shared/** @DevExpress/devextreme-grids
/js/common/grids.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/scss/widgets/base/_gridBase.scss @DevExpress/devextreme-grids
/scss/widgets/generic/gridBase/** @DevExpress/devextreme-grids
/scss/widgets/material/gridBase/** @DevExpress/devextreme-grids
/packages/devextreme/js/__internal/grids/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/grid_core/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/shared/** @DevExpress/devextreme-grids
/packages/devextreme/js/common/grids.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/scss/widgets/base/_gridBase.scss @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/gridBase/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/gridBase/** @DevExpress/devextreme-grids

## data_grid

/js/ui/data_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/js/ui/data_grid.js @DevExpress/devextreme-grids
/js/ui/data_grid/** @DevExpress/devextreme-grids
/scss/widgets/base/dataGrid/** @DevExpress/devextreme-grids
/scss/widgets/generic/dataGrid/** @DevExpress/devextreme-grids
/scss/widgets/material/dataGrid/** @DevExpress/devextreme-grids
/testing/tests/DevExpress.ui.widgets.dataGrid/** @DevExpress/devextreme-grids
/testing/testcafe/model/dataGrid/** @DevExpress/devextreme-grids
/testing/testcafe/tests/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/data_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/data_grid.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/data_grid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/base/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/dataGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/dataGrid/** @DevExpress/devextreme-grids

## tree_list

/js/ui/tree_list.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/js/ui/tree_list.js @DevExpress/devextreme-grids
/js/ui/tree_list/** @DevExpress/devextreme-grids
/scss/widgets/base/treeList/** @DevExpress/devextreme-grids
/scss/widgets/generic/treeList/** @DevExpress/devextreme-grids
/scss/widgets/material/treeList/** @DevExpress/devextreme-grids
/testing/tests/DevExpress.ui.widgets.treeList/** @DevExpress/devextreme-grids
/testing/testcafe/model/treeList.ts @DevExpress/devextreme-grids
/testing/testcafe/tests/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/tree_list.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/tree_list.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/tree_list/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/base/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/treeList/** @DevExpress/devextreme-grids
/packages/devextreme/testing/tests/DevExpress.ui.widgets.treeList/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/treeList.ts @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/treeList/** @DevExpress/devextreme-grids

## pivot_grid

/js/ui/pivot_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/js/ui/pivot_grid.js @DevExpress/devextreme-grids
/js/ui/pivot_grid/** @DevExpress/devextreme-grids
/scss/widgets/base/pivotGrid/** @DevExpress/devextreme-grids
/scss/widgets/generic/pivotGrid/** @DevExpress/devextreme-grids
/scss/widgets/material/pivotGrid/** @DevExpress/devextreme-grids
/testing/tests/DevExpress.ui.widgets.pivotGrid/** @DevExpress/devextreme-grids
/testing/testcafe/model/pivotGrid/** @DevExpress/devextreme-grids
/testing/testcafe/tests/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/js/ui/pivot_grid.d.ts @DevExpress/devextreme-grids @DevExpress/devextreme-apireviewers @DevExpress/devextreme-techwriters
/packages/devextreme/js/ui/pivot_grid.js @DevExpress/devextreme-grids
/packages/devextreme/js/ui/pivot_grid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/base/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/generic/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/scss/widgets/material/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/model/pivotGrid/** @DevExpress/devextreme-grids
/packages/devextreme/testing/testcafe/tests/pivotGrid/** @DevExpress/devextreme-grids

# DevOps

Expand Down
14 changes: 10 additions & 4 deletions .github/actions/run-qunit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,34 @@ runs:
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ./node_modules
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-package-lock --no-audit --no-fund
run: npm install --no-audit --no-fund

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: devextreme-artifacts
path: packages/devextreme

- name: Unpack artifacts
working-directory: ./packages/devextreme
shell: bash
run: 7z x artifacts.zip
run: |
rm -rf artifacts/npm
7z x artifacts.zip
- name: Build dotnet
working-directory: ./packages/devextreme
shell: bash
run: dotnet build build/build-dotnet.sln

- name: Run QUnit tests
working-directory: ./packages/devextreme
shell: bash
env:
CONSTEL: ${{ inputs.constel }}
Expand All @@ -118,5 +124,5 @@ runs:
uses: actions/upload-artifact@v3
with:
name: RawLog-${{ env.MATRIX_ENVS_NAME_SAFE }}
path: ${{ github.workspace }}/testing/RawLog.txt
path: ${{ github.workspace }}/packages/devextreme/testing/RawLog.txt
if-no-files-found: ignore
90 changes: 48 additions & 42 deletions .github/workflows/devextreme_npm_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
push:
branches: [23_2]

env:
NX_SKIP_NX_CACHE: ${{ (github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'skip-cache')) && 'true' || 'false' }}

jobs:
build:
runs-on: devextreme-shr2
Expand All @@ -25,34 +28,28 @@ jobs:
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ./node_modules
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules

- name: Restore artifacts cache
uses: actions/cache@v3
with:
path: ./artifacts
key: build-npm-devextreme-artifacts-${{ github.sha }}

- name: Install packages in devextreme repo
run: test -d artifacts || npm install --no-audit --no-fund
run: npm install --no-audit --no-fund

- name: Build devextreme repo
run: test -d artifacts || npm run build-npm-devextreme
run: npx nx build devextreme-root

- name: Pack devextreme package
working-directory: ./artifacts/npm/devextreme
working-directory: ./packages/devextreme/artifacts/npm/devextreme
run: npm pack

- name: Pack devextreme-dist package
working-directory: ./artifacts/npm/devextreme-dist
working-directory: ./packages/devextreme/artifacts/npm/devextreme-dist
run: npm pack

- name: Copy packages
run: |
cp ./artifacts/npm/devextreme/*.tgz ./devextreme-installer.tgz
cp ./artifacts/npm/devextreme-dist/*.tgz ./devextreme-dist-installer.tgz
cp ./packages/devextreme/artifacts/npm/devextreme/*.tgz ./devextreme-installer.tgz
cp ./packages/devextreme/artifacts/npm/devextreme-dist/*.tgz ./devextreme-dist-installer.tgz
- name: Copy build artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -82,7 +79,7 @@ jobs:
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ./node_modules
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules

Expand All @@ -93,21 +90,20 @@ jobs:
uses: actions/download-artifact@v3
with:
name: devextreme-npm
path: ./testing/renovation-npm/${{ matrix.framework }}-app
path: ./packages/devextreme/testing/renovation-npm/${{ matrix.framework }}-app

- name: Prepare artifacts
run: |
mkdir -p ./artifacts/npm
cp ./testing/renovation-npm/${{ matrix.framework }}-app/devextreme-installer.tgz ./artifacts/npm/devextreme.tgz
cd ./artifacts/npm
cp ./packages/devextreme/testing/renovation-npm/${{ matrix.framework }}-app/devextreme-installer.tgz ./packages/devextreme/artifacts/npm/devextreme.tgz
cd ./packages/devextreme/artifacts/npm
tar -xzf devextreme.tgz
mv package devextreme
- name: Build Renovated NPM
run: npm run build-npm-renovation:${{ matrix.framework }}
run: npx nx build-npm-renovation:${{ matrix.framework }} devextreme-root

- name: Prepare test project
working-directory: ./testing/renovation-npm
working-directory: ./packages/devextreme/testing/renovation-npm
run: |
npm i
Expand All @@ -124,7 +120,7 @@ jobs:
exit 1
- name: Run tests
working-directory: ./testing/renovation-npm
working-directory: ./packages/devextreme/testing/renovation-npm
run: |
npm run test:${{ matrix.framework }}
Expand All @@ -133,7 +129,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: compared-screenshots
path: ${{ github.workspace }}/testing/renovation-npm/tests/artifacts
path: ${{ github.workspace }}/packages/devextreme/testing/renovation-npm/tests/artifacts
if-no-files-found: ignore

test_angular_wrappers:
Expand All @@ -153,21 +149,18 @@ jobs:

- uses: ./.github/actions/pin-browsers

- name: Create directory link
run: cd ../ && ln -s DevExtreme devextreme

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

- name: Install packages in devextreme repo
run: npm install --no-audit --no-fund

- name: Discover declarations in devextreme repo
run: npm run discover-declarations
run: npx nx discover-declarations devextreme-root

- name: Clone devextreme-angular repo from PR author fork
continue-on-error: true
Expand Down Expand Up @@ -207,13 +200,21 @@ jobs:
cd ../../
npm install --save-dev --legacy-peer-deps $installerName
- name: Move devextreme-angular-repo to packages
run: mv ../devextreme-angular-repo ./packages

- name: Build with Angular 12
working-directory: ../devextreme-angular-repo
run: npm run build
working-directory: packages/devextreme-angular-repo
run: |
npm run update-integration-meta
cd packages/devextreme-angular-generator
npm run build
cd ../devextreme-angular
npm run build
- name: Run tests with Angular 12
working-directory: ../devextreme-angular-repo
run: npm run test:dev --workspace=devextreme-angular
working-directory: packages/devextreme-angular-repo/packages/devextreme-angular
run: npm run test:dev

test_bundlers:
name: Bundlers tests
Expand All @@ -234,42 +235,42 @@ jobs:
uses: actions/download-artifact@v3
with:
name: devextreme-npm
path: ./testing/bundlers
path: ./packages/devextreme/testing/bundlers

- name: Install bundlers
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm install --no-audit --no-fund

- name: Install DevExtreme package
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm install --save-dev devextreme-installer.tgz

- name: Generate entry files
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run generate-entry-files

- name: Build webpack cjs
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run build:webpack-cjs

- name: Build browserify cjs
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run build:browserify-cjs

- name: Build webpack
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run build:webpack

- name: Build rollup
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run build:rollup

- name: Build parcel
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run build:parcel

- name: Build vite
working-directory: ./testing/bundlers
working-directory: ./packages/devextreme/testing/bundlers
run: npm run build:vite

test_demos:
Expand Down Expand Up @@ -363,7 +364,12 @@ jobs:
notify:
runs-on: devextreme-shr2
name: Send notifications
needs: [build, test_angular_wrappers, test_bundlers, test_demos, test_npm_renovation]
needs:
- build
- test_angular_wrappers
- test_bundlers
- test_demos
- test_npm_renovation
if: always() && contains(needs.*.result, 'failure')

steps:
Expand Down
Loading

0 comments on commit a99816b

Please sign in to comment.