chore: add workflow_dispatch to CodeQL workflow #1035
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' | |
| cache-dependency-path: | | |
| package-lock.json | |
| apps/nextjs-testing/**/package-lock.json | |
| - 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 'npm run regenerate-nextjs-apps' and commit the results" | |
| exit 1 | |
| fi | |
| shell: bash | |
| - name: Install devextreme-cli dependencies | |
| run: npm ci --prefix packages/devextreme-cli | |
| 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 |