|
1 |
| -name: DevExtreme Wrappers Tests |
| 1 | +name: Wrappers Tests |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | pull_request:
|
|
13 | 13 | BUILD_TEST_INTERNAL_PACKAGE: true
|
14 | 14 |
|
15 | 15 | jobs:
|
16 |
| - test: |
| 16 | + build: |
17 | 17 | runs-on: devextreme-shr2
|
18 |
| - timeout-minutes: 80 |
| 18 | + timeout-minutes: 15 |
19 | 19 |
|
20 | 20 | steps:
|
21 | 21 | - name: Get sources
|
22 | 22 | uses: actions/checkout@v4
|
23 | 23 |
|
24 |
| - - name: Setup Chrome |
25 |
| - uses: ./.github/actions/setup-chrome |
26 |
| - with: |
27 |
| - chrome-version: '133.0.6943.53' |
28 |
| - |
29 | 24 | - name: Use Node.js
|
30 | 25 | uses: actions/setup-node@v4
|
31 | 26 | with:
|
@@ -60,48 +55,121 @@ jobs:
|
60 | 55 | working-directory: ./packages/devextreme
|
61 | 56 | run: pnpx nx build
|
62 | 57 |
|
| 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 | + |
63 | 94 | - name: Generate wrappers
|
64 | 95 | run: pnpm run regenerate-all
|
65 | 96 |
|
| 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 | + |
66 | 104 | - 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 |
67 | 113 | shell: bash
|
68 | 114 | 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 |
72 | 117 | echo "Generated code is outdated. The following files have uncommitted changes:"
|
73 |
| - echo "$changes"; |
| 118 | + jq '.' diff.json |
| 119 | +
|
| 120 | + echo |
74 | 121 | echo "To update generated code, use "pnpm run regenerate-all" and commit changes."
|
75 | 122 | exit 1
|
| 123 | + else |
| 124 | + echo "No changes in generated code." |
76 | 125 | fi
|
77 | 126 |
|
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 |
80 | 139 |
|
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' |
83 | 144 |
|
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 |
86 | 149 |
|
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 |
89 | 153 |
|
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 |
92 | 163 |
|
93 |
| - - name: React - Check packing |
94 |
| - run: pnpm exec nx pack devextreme-react |
| 164 | + - name: Install dependencies |
| 165 | + run: pnpm install |
95 | 166 |
|
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] |
98 | 170 |
|
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 }} |
101 | 173 |
|
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