Skip to content

Commit 01c839d

Browse files
authored
fix: added label and changed checker in CI (#30428)
1 parent 393fff2 commit 01c839d

File tree

1 file changed

+102
-34
lines changed

1 file changed

+102
-34
lines changed
Lines changed: 102 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: DevExtreme Wrappers Tests
1+
name: Wrappers Tests
22

33
on:
44
pull_request:
@@ -13,19 +13,14 @@ env:
1313
BUILD_TEST_INTERNAL_PACKAGE: true
1414

1515
jobs:
16-
test:
16+
build:
1717
runs-on: devextreme-shr2
18-
timeout-minutes: 80
18+
timeout-minutes: 15
1919

2020
steps:
2121
- name: Get sources
2222
uses: actions/checkout@v4
2323

24-
- name: Setup Chrome
25-
uses: ./.github/actions/setup-chrome
26-
with:
27-
chrome-version: '133.0.6943.53'
28-
2924
- name: Use Node.js
3025
uses: actions/setup-node@v4
3126
with:
@@ -60,48 +55,121 @@ jobs:
6055
working-directory: ./packages/devextreme
6156
run: pnpx nx build
6257

58+
check-regenerate:
59+
runs-on: devextreme-shr2
60+
timeout-minutes: 10
61+
62+
steps:
63+
- name: Get sources
64+
uses: actions/checkout@v4
65+
66+
- name: Use Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: '20'
70+
71+
- uses: pnpm/action-setup@v3
72+
with:
73+
version: 9
74+
run_install: false
75+
76+
- name: Get pnpm store directory
77+
shell: bash
78+
run: |
79+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
80+
81+
- uses: actions/cache@v4
82+
name: Setup pnpm cache
83+
with:
84+
path: |
85+
${{ env.STORE_PATH }}
86+
.nx/cache
87+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
88+
restore-keys: |
89+
${{ runner.os }}-pnpm-store
90+
91+
- name: Install dependencies
92+
run: pnpm install
93+
6394
- name: Generate wrappers
6495
run: pnpm run regenerate-all
6596

97+
- name: Archive devextreme-metadata artifacts
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: devextreme-metadata-artifacts
101+
path: packages/devextreme-metadata/dist/
102+
retention-days: 1
103+
66104
- name: Check generated code
105+
id: check-diff
106+
uses: DevExpress/github-actions/get-changed-files@v1
107+
with:
108+
gh-token: ${{ secrets.GITHUB_TOKEN }}
109+
paths: 'packages/devextreme-*/src/**'
110+
output: diff.json
111+
112+
- name: Fail if generated code is outdated
67113
shell: bash
68114
run: |
69-
git add . -N
70-
changes=$(git diff --name-status HEAD -- packages/devextreme-angular/src packages/devextreme-react/src packages/devextreme-vue/src)
71-
if [ -n "$changes" ]; then
115+
count=$(jq length diff.json)
116+
if [ "$count" -gt 0 ]; then
72117
echo "Generated code is outdated. The following files have uncommitted changes:"
73-
echo "$changes";
118+
jq '.' diff.json
119+
120+
echo
74121
echo "To update generated code, use "pnpm run regenerate-all" and commit changes."
75122
exit 1
123+
else
124+
echo "No changes in generated code."
76125
fi
77126
78-
- name: Angular - Download Browser
79-
run: pnpx puppeteer browsers install [email protected]
127+
test:
128+
runs-on: devextreme-shr2
129+
timeout-minutes: 10
130+
needs: build
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
framework: [angular, react, vue]
135+
136+
steps:
137+
- name: Get sources
138+
uses: actions/checkout@v4
80139

81-
- name: Angular - Build
82-
run: pnpx nx build devextreme-angular
140+
- name: Use Node.js
141+
uses: actions/setup-node@v4
142+
with:
143+
node-version: '20'
83144

84-
- name: Angular - Run tests
85-
run: pnpx nx test:dev devextreme-angular
145+
- uses: pnpm/action-setup@v3
146+
with:
147+
version: 9
148+
run_install: false
86149

87-
- name: Angular - Check packing
88-
run: pnpx nx pack devextreme-angular
150+
- name: Get pnpm store directory
151+
shell: bash
152+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
89153

90-
- name: React - Run tests
91-
run: pnpm exec nx test devextreme-react
154+
- uses: actions/cache@v4
155+
name: Setup pnpm cache
156+
with:
157+
path: |
158+
${{ env.STORE_PATH }}
159+
.nx/cache
160+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
161+
restore-keys: |
162+
${{ runner.os }}-pnpm-store
92163
93-
- name: React - Check packing
94-
run: pnpm exec nx pack devextreme-react
164+
- name: Install dependencies
165+
run: pnpm install
95166

96-
- name: Vue - Run tests
97-
run: pnpx nx test devextreme-vue
167+
- name: Download Browser
168+
if: matrix.framework == 'angular'
169+
run: pnpx puppeteer browsers install [email protected]
98170

99-
- name: Vue - Check packing
100-
run: pnpx nx pack devextreme-vue
171+
- name: Test ${{ matrix.framework }}
172+
run: pnpx nx test devextreme-${{ matrix.framework }}
101173

102-
- name: Archive devextreme-metadata artifacts
103-
uses: actions/upload-artifact@v4
104-
with:
105-
name: devextreme-metadata-artifacts
106-
path: packages/devextreme-metadata/dist/
107-
retention-days: 7
174+
- name: Pack ${{ matrix.framework }}
175+
run: pnpx nx pack devextreme-${{ matrix.framework }}

0 commit comments

Comments
 (0)