-
Notifications
You must be signed in to change notification settings - Fork 31
96 lines (80 loc) · 3.11 KB
/
check-nextjs.yml
File metadata and controls
96 lines (80 loc) · 3.11 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
95
96
name: Check "add devextreme-react" for NextJS app
on:
push:
branches: [ "master" ]
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: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.NODE }}
cache: 'pnpm'
- name: Determine test app directory
run: |
TS_PART=${{ matrix.TYPESCRIPT == true && 'ts' || 'js' }}
SRC_PART=${{ matrix.SRC_DIR == true && 'src' || 'nosrc' }}
ROUTER_PART=${{ matrix.APP_ROUTER == true && 'app' || 'pages' }}
echo "TEST_APP_DIR=apps/nextjs-testing/${TS_PART}-${SRC_PART}-${ROUTER_PART}" >> $GITHUB_ENV
shell: bash
- name: Verify committed apps are up-to-date
run: |
EXPECTED_VERSION=$(node -e "const v = require('./packages/devextreme-cli/src/utility/latest-versions.js'); console.log(v['create-next-app'])")
COMMITTED_VERSION=$(node -e "const m = require('./apps/nextjs-testing/.generator-meta.json'); console.log(m['create-next-app'])")
if [ "$EXPECTED_VERSION" != "$COMMITTED_VERSION" ]; then
echo "ERROR: Committed test apps use create-next-app@$COMMITTED_VERSION but latest-versions.js specifies $EXPECTED_VERSION"
echo "Run 'pnpm run regenerate-nextjs-apps' and commit the results"
exit 1
fi
shell: bash
- name: Install devextreme-cli dependencies
env:
PUPPETEER_SKIP_DOWNLOAD: true
run: pnpm install --frozen-lockfile
timeout-minutes: 5
- name: Install test app dependencies
run: cd ${{ env.TEST_APP_DIR }} && npm ci
timeout-minutes: 5
- name: Add DevExtreme to Next.js application
run: |
cd ${{ env.TEST_APP_DIR }}
node ../../../packages/devextreme-cli/index.js add devextreme-react
shell: bash
timeout-minutes: 15
- name: Verify DevExtreme dependencies in package.json
run: |
cd ${{ env.TEST_APP_DIR }}
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 ${{ env.TEST_APP_DIR }}
npm run build
shell: bash
timeout-minutes: 15