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