-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26367 from mshima/blueprints
improvements to blueprints
- Loading branch information
Showing
5 changed files
with
149 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
39 changes: 39 additions & 0 deletions
39
generators/generate-blueprint/templates/.github/workflows/build-cache.yml.ejs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: build-cache | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
jobs: | ||
build-cache: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ${{ github.workspace }}/app | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: generator-jhipster-<%= baseName %> | ||
- uses: jhipster/actions/setup-runner@v0 | ||
with: | ||
node-version: 20 | ||
binary-dir: ${{ github.workspace }}/generator-jhipster-<%= baseName %>/cli/ | ||
- uses: jhipster/actions/cache-npm-dependencies@v0 | ||
with: | ||
generator-path: generator-jhipster-<%= baseName %> | ||
if: always() | ||
- run: cli.cjs generate-sample --all | ||
continue-on-error: true | ||
- run: npm run backend:build-cache --workspaces | ||
continue-on-error: true | ||
- uses: jhipster/actions/save-cache@v0 | ||
if: always() | ||
with: | ||
key: ${{ github.run_id }} | ||
npm: true | ||
maven: true | ||
gradle: true | ||
- uses: jhipster/actions/restore-cache@v0 | ||
with: | ||
npm: true | ||
maven: true | ||
gradle: true |
105 changes: 105 additions & 0 deletions
105
generators/generate-blueprint/templates/.github/workflows/samples.yml.ejs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Verify Sample Projects | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- '**maintenance' | ||
paths-ignore: | ||
- 'package*.json' | ||
pull_request: | ||
branches: | ||
- '*' | ||
permissions: | ||
contents: read | ||
jobs: | ||
build-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.build.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: <%- nodeVersion.split('.', 2)[0] %> | ||
- id: build | ||
run: | | ||
npm install | ||
./cli/cli.cjs github-build-matrix | ||
samples: | ||
name: ${{ matrix.sample-name }} | ||
runs-on: ubuntu-latest | ||
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@v4 | ||
with: | ||
path: generator-jhipster-<%= baseName %> | ||
fetch-depth: 2 | ||
- uses: jhipster/actions/setup-runner@v0 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
node-version: ${{ matrix.node-version }} | ||
maven-cache: true | ||
gradle-cache: true | ||
binary-dir: ${{ github.workspace }}/generator-jhipster-<%= baseName %>/cli/ | ||
- name: 'Install blueprint' | ||
run: npm install | ||
working-directory: ${{ github.workspace }}/generator-jhipster-<%= baseName %> | ||
- name: 'Generate Project' | ||
run: cli.cjs generate-sample ${{ matrix.sample-name }} --skip-jhipster-dependencies --force | ||
- uses: jhipster/actions/compare-sample@v0 | ||
id: compare | ||
if: >- | ||
github.event.pull_request && | ||
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare') | ||
with: | ||
generator-path: generator-jhipster-<%= baseName %> | ||
cmd: cli.cjs generate-sample ${{ matrix.sample-name }} --skip-jhipster-dependencies --force --skip-install | ||
- run: npm run ci:backend:test | ||
if: steps.compare.outputs.equals != 'true' | ||
id: backend | ||
- run: npm run ci:frontend:test --if-present | ||
if: steps.compare.outputs.equals != 'true' | ||
- run: npm run ci:e2e:package | ||
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: 'BACKEND: Store failure logs' | ||
uses: actions/upload-artifact@v4 | ||
if: always() && steps.backend.outcome == 'failure' | ||
with: | ||
name: log-${{ matrix.sample-name }} | ||
path: | | ||
${{ github.workspace }}/app/build/test-results/**/*.xml | ||
${{ github.workspace }}/app/target/surefire-reports | ||
- name: 'E2E: Store failure screenshots' | ||
uses: actions/upload-artifact@v4 | ||
if: always() && steps.e2e.outcome == 'failure' | ||
with: | ||
name: screenshots-${{ matrix.sample-name }} | ||
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 |