chore: migrate to typescript #282
Workflow file for this run
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: Verify Sample Projects | |
| concurrency: | |
| # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. | |
| group: ${{ github.workflow }}-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - '**maintenance' | |
| paths-ignore: | |
| - 'package*.json' | |
| pull_request: | |
| branches: | |
| - '*' | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_COLOR: 2 | |
| jobs: | |
| build-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.build.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - id: build | |
| run: | | |
| npm install | |
| ./cli/cli.cts github-build-matrix | |
| samples: | |
| name: ${{ matrix.job-name || matrix.sample }} | |
| runs-on: ${{ matrix.os }} | |
| needs: build-matrix | |
| defaults: | |
| run: | |
| working-directory: ${{ github.workspace }}/app | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: generator-jhipster-entity-audit | |
| fetch-depth: 2 | |
| - uses: jhipster/actions/setup-runner@v1 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| node-version: ${{ matrix.node-version }} | |
| maven-cache: true | |
| gradle-cache: true | |
| binary-dir: ${{ github.workspace }}/generator-jhipster-entity-audit/cli/ | |
| - run: npm install | |
| working-directory: ${{ github.workspace }}/generator-jhipster-entity-audit | |
| - run: cli.cts generate-sample ${{ matrix.sample }} --skip-jhipster-dependencies --skip-install ${{ matrix.extra-args }} | |
| - uses: jhipster/actions/compare-sample@v1 | |
| id: compare | |
| if: >- | |
| github.event.pull_request && | |
| !contains(github.event.pull_request.labels.*.name, 'pr: disable-compare') | |
| with: | |
| generator-path: generator-jhipster-entity-audit | |
| cmd: cli.cjs generate-sample ${{ matrix.sample }} --skip-jhipster-dependencies --skip-install ${{ matrix.extra-args }} | |
| - run: npm run ci:backend:test | |
| if: steps.compare.outputs.equals != 'true' | |
| id: backend | |
| - run: npm run ci:e2e:package | |
| if: steps.compare.outputs.equals != 'true' | |
| - run: npm run ci:frontend:test --if-present | |
| if: steps.compare.outputs.equals != 'true' | |
| - run: npm run ci:e2e:prepare | |
| if: steps.compare.outputs.equals != 'true' | |
| - run: npm run ci:e2e:run --if-present | |
| if: steps.compare.outputs.equals != 'true' | |
| id: e2e | |
| - name: Store backend test failure logs | |
| uses: actions/upload-artifact@v7 | |
| if: always() && steps.backend.outcome == 'failure' | |
| with: | |
| name: log-${{ matrix.job-name || matrix.sample }} | |
| path: | | |
| ${{ github.workspace }}/app/build/test-results/**/*.xml | |
| ${{ github.workspace }}/app/target/surefire-reports | |
| - name: Store cypress screenshots | |
| uses: actions/upload-artifact@v7 | |
| if: always() && steps.e2e.outcome == 'failure' | |
| with: | |
| name: screenshots-${{ matrix.job-name || matrix.sample }} | |
| path: ${{ github.workspace }}/app/**/cypress/screenshots | |
| - name: Dump docker logs | |
| if: always() | |
| uses: jwalton/gh-docker-logs@v2 | |
| check-samples: | |
| permissions: | |
| contents: none | |
| runs-on: ubuntu-latest | |
| needs: [samples] | |
| if: always() | |
| steps: | |
| - run: | | |
| echo '${{ toJSON(needs) }}' | |
| if [ 'skipped' == '${{ needs.samples.result }}' ] || [ 'success' == '${{ needs.samples.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then | |
| exit 0 | |
| fi | |
| exit 1 |