|
| 1 | +name: Check "add devextreme-react" for NextJS app |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + nextjs-devextreme-test: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + TYPESCRIPT: [true, false] |
| 14 | + SRC_DIR: [true, false] |
| 15 | + APP_ROUTER: [true, false] |
| 16 | + NODE: |
| 17 | + - 18 |
| 18 | + OS: |
| 19 | + - ubuntu-latest |
| 20 | + |
| 21 | + runs-on: ${{ matrix.OS }} |
| 22 | + name: Next.js + DevExtreme (TS:${{ matrix.TYPESCRIPT }}, src:${{ matrix.SRC_DIR }}, app-router:${{ matrix.APP_ROUTER }}), node ${{ matrix.NODE }}, ${{ matrix.OS }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Get sources |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Set up Node.js |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: ${{ matrix.NODE }} |
| 32 | + cache: 'npm' |
| 33 | + |
| 34 | + - name: Create Next.js application |
| 35 | + run: | |
| 36 | + npx create-next-app@latest test-nextjs-app \ |
| 37 | + --typescript=${{ matrix.TYPESCRIPT }} \ |
| 38 | + --src-dir=${{ matrix.SRC_DIR }} \ |
| 39 | + --app=${{ matrix.APP_ROUTER }} \ |
| 40 | + --eslint=true \ |
| 41 | + --tailwind=true \ |
| 42 | + --import-alias="@/*" \ |
| 43 | + --no-git \ |
| 44 | + --use-npm |
| 45 | + shell: bash |
| 46 | + |
| 47 | + - name: Add actual devExtreme-cli |
| 48 | + run: | |
| 49 | + cd test-nextjs-app |
| 50 | + npm add devextreme-cli |
| 51 | + rm -r .\node_modules\devextreme-cli\src\ |
| 52 | + cp -r ..\packages\devextreme-cli\src\ .\node_modules\devextreme-cli\ |
| 53 | + shell: bash |
| 54 | + timeout-minutes: 15 |
| 55 | + |
| 56 | + - name: Add DevExtreme to Next.js application |
| 57 | + run: | |
| 58 | + cd test-nextjs-app |
| 59 | + npx devextreme-cli add devextreme-react |
| 60 | + shell: bash |
| 61 | + timeout-minutes: 15 |
| 62 | + |
| 63 | + - name: Verify DevExtreme dependencies in package.json |
| 64 | + run: | |
| 65 | + cd test-nextjs-app |
| 66 | +
|
| 67 | + if ! grep -q '"devextreme":' package.json; then |
| 68 | + echo "Error: devextreme dependency not found in package.json" |
| 69 | + exit 1 |
| 70 | + fi |
| 71 | +
|
| 72 | + if ! grep -q '"devextreme-react":' package.json; then |
| 73 | + echo "Error: devextreme-react dependency not found in package.json" |
| 74 | + exit 1 |
| 75 | + fi |
| 76 | +
|
| 77 | + echo "DevExtreme dependencies successfully installed" |
| 78 | + shell: bash |
| 79 | + |
| 80 | + - name: Build Next.js application |
| 81 | + run: | |
| 82 | + cd test-nextjs-app |
| 83 | + npm run build |
| 84 | + shell: bash |
| 85 | + timeout-minutes: 15 |
0 commit comments