Skip to content

Commit 7b68e2e

Browse files
committed
[skip-ci] add angular-webpack sample group
1 parent 8f35a1b commit 7b68e2e

File tree

5 files changed

+325
-3
lines changed

5 files changed

+325
-3
lines changed

.blueprint/github-build-matrix/__snapshots__/generator.spec.ts.snap

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,173 @@ exports[`generator - github-build-matrix with angular should match matrix value
429429
}"
430430
`;
431431

432+
exports[`generator - github-build-matrix with daily-builds/angular-webpack should match matrix value 1`] = `
433+
"{
434+
"include": [
435+
{
436+
"job-name": "monolith-maven-reactive(false)",
437+
"sample": "monolith-maven-reactive(false)",
438+
"os": "ubuntu-latest",
439+
"node-version": "NODE-VERSION",
440+
"java-version": "JAVA-VERSION",
441+
"npm-version": "NPM-VERSION",
442+
"default-environment": "prod",
443+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
444+
"args": "jdl",
445+
"cmd-frontend": "./npmw run ci:frontend:test",
446+
"cmd-backend": "./npmw run ci:backend:test",
447+
"cmd-e2e-1": "./npmw run e2e:devserver",
448+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
449+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType monolith\\n buildTool maven\\n reactive false\\n }\\n}",
450+
"samples-group": "angular-webpack",
451+
"build-jhipster-bom": true,
452+
"jhipster-bom-branch": "main",
453+
"jhipster-bom-cicd-version": "0.0.0-CICD"
454+
},
455+
{
456+
"job-name": "monolith-maven-reactive(true)",
457+
"sample": "monolith-maven-reactive(true)",
458+
"os": "ubuntu-latest",
459+
"node-version": "NODE-VERSION",
460+
"java-version": "JAVA-VERSION",
461+
"npm-version": "NPM-VERSION",
462+
"default-environment": "prod",
463+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
464+
"args": "jdl",
465+
"cmd-frontend": "./npmw run ci:frontend:test",
466+
"cmd-backend": "./npmw run ci:backend:test",
467+
"cmd-e2e-1": "./npmw run e2e:devserver",
468+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
469+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType monolith\\n buildTool maven\\n reactive true\\n }\\n}",
470+
"samples-group": "angular-webpack",
471+
"build-jhipster-bom": true,
472+
"jhipster-bom-branch": "main",
473+
"jhipster-bom-cicd-version": "0.0.0-CICD"
474+
},
475+
{
476+
"job-name": "monolith-gradle-reactive(false)-spring-websocket",
477+
"sample": "monolith-gradle-reactive(false)-spring-websocket",
478+
"os": "ubuntu-latest",
479+
"node-version": "NODE-VERSION",
480+
"java-version": "JAVA-VERSION",
481+
"npm-version": "NPM-VERSION",
482+
"default-environment": "prod",
483+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
484+
"args": "jdl",
485+
"cmd-frontend": "./npmw run ci:frontend:test",
486+
"cmd-backend": "./npmw run ci:backend:test",
487+
"cmd-e2e-1": "./npmw run e2e:devserver",
488+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
489+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType monolith\\n buildTool gradle\\n reactive false\\n websocket spring-websocket\\n }\\n}",
490+
"samples-group": "angular-webpack",
491+
"build-jhipster-bom": true,
492+
"jhipster-bom-branch": "main",
493+
"jhipster-bom-cicd-version": "0.0.0-CICD"
494+
},
495+
{
496+
"job-name": "monolith-gradle-reactive(true)",
497+
"sample": "monolith-gradle-reactive(true)",
498+
"os": "ubuntu-latest",
499+
"node-version": "NODE-VERSION",
500+
"java-version": "JAVA-VERSION",
501+
"npm-version": "NPM-VERSION",
502+
"default-environment": "prod",
503+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
504+
"args": "jdl",
505+
"cmd-frontend": "./npmw run ci:frontend:test",
506+
"cmd-backend": "./npmw run ci:backend:test",
507+
"cmd-e2e-1": "./npmw run e2e:devserver",
508+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
509+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType monolith\\n buildTool gradle\\n reactive true\\n }\\n}",
510+
"samples-group": "angular-webpack",
511+
"build-jhipster-bom": true,
512+
"jhipster-bom-branch": "main",
513+
"jhipster-bom-cicd-version": "0.0.0-CICD"
514+
},
515+
{
516+
"job-name": "gateway-maven-reactive(false)",
517+
"sample": "gateway-maven-reactive(false)",
518+
"os": "ubuntu-latest",
519+
"node-version": "NODE-VERSION",
520+
"java-version": "JAVA-VERSION",
521+
"npm-version": "NPM-VERSION",
522+
"default-environment": "prod",
523+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
524+
"args": "jdl --experimental",
525+
"cmd-frontend": "./npmw run ci:frontend:test",
526+
"cmd-backend": "./npmw run ci:backend:test",
527+
"cmd-e2e-1": "./npmw run e2e:devserver",
528+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
529+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType gateway\\n buildTool maven\\n reactive false\\n }\\n}",
530+
"samples-group": "angular-webpack",
531+
"build-jhipster-bom": true,
532+
"jhipster-bom-branch": "main",
533+
"jhipster-bom-cicd-version": "0.0.0-CICD"
534+
},
535+
{
536+
"job-name": "gateway-maven-reactive(true)",
537+
"sample": "gateway-maven-reactive(true)",
538+
"os": "ubuntu-latest",
539+
"node-version": "NODE-VERSION",
540+
"java-version": "JAVA-VERSION",
541+
"npm-version": "NPM-VERSION",
542+
"default-environment": "prod",
543+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
544+
"args": "jdl",
545+
"cmd-frontend": "./npmw run ci:frontend:test",
546+
"cmd-backend": "./npmw run ci:backend:test",
547+
"cmd-e2e-1": "./npmw run e2e:devserver",
548+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
549+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType gateway\\n buildTool maven\\n reactive true\\n }\\n}",
550+
"samples-group": "angular-webpack",
551+
"build-jhipster-bom": true,
552+
"jhipster-bom-branch": "main",
553+
"jhipster-bom-cicd-version": "0.0.0-CICD"
554+
},
555+
{
556+
"job-name": "gateway-gradle-reactive(false)-spring-websocket",
557+
"sample": "gateway-gradle-reactive(false)-spring-websocket",
558+
"os": "ubuntu-latest",
559+
"node-version": "NODE-VERSION",
560+
"java-version": "JAVA-VERSION",
561+
"npm-version": "NPM-VERSION",
562+
"default-environment": "prod",
563+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
564+
"args": "jdl --experimental",
565+
"cmd-frontend": "./npmw run ci:frontend:test",
566+
"cmd-backend": "./npmw run ci:backend:test",
567+
"cmd-e2e-1": "./npmw run e2e:devserver",
568+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
569+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType gateway\\n buildTool gradle\\n reactive false\\n websocket spring-websocket\\n }\\n}",
570+
"samples-group": "angular-webpack",
571+
"build-jhipster-bom": true,
572+
"jhipster-bom-branch": "main",
573+
"jhipster-bom-cicd-version": "0.0.0-CICD"
574+
},
575+
{
576+
"job-name": "gateway-gradle-reactive(true)",
577+
"sample": "gateway-gradle-reactive(true)",
578+
"os": "ubuntu-latest",
579+
"node-version": "NODE-VERSION",
580+
"java-version": "JAVA-VERSION",
581+
"npm-version": "NPM-VERSION",
582+
"default-environment": "prod",
583+
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
584+
"args": "jdl",
585+
"cmd-frontend": "./npmw run ci:frontend:test",
586+
"cmd-backend": "./npmw run ci:backend:test",
587+
"cmd-e2e-1": "./npmw run e2e:devserver",
588+
"cmd-e2e-2": "./npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run",
589+
"jdl": "application {\\n config {\\n testFrameworks [cypress]\\n applicationType gateway\\n buildTool gradle\\n reactive true\\n }\\n}",
590+
"samples-group": "angular-webpack",
591+
"build-jhipster-bom": true,
592+
"jhipster-bom-branch": "main",
593+
"jhipster-bom-cicd-version": "0.0.0-CICD"
594+
}
595+
]
596+
}"
597+
`;
598+
432599
exports[`generator - github-build-matrix with devserver should match matrix value 1`] = `
433600
"{
434601
"include": [

.blueprint/github-build-matrix/command.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import type { JHipsterCommandDefinition } from '../../lib/command/index.ts';
22

3-
export const workflowChoices = ['angular', 'devserver', 'graalvm', 'react', 'docker-compose-integration', 'vue'] as const;
3+
export const workflowChoices = [
4+
'angular',
5+
'devserver',
6+
'graalvm',
7+
'react',
8+
'docker-compose-integration',
9+
'vue',
10+
'daily-builds/angular-webpack',
11+
] as const;
412
export const eventNameChoices = ['push', 'pull_request', 'daily'] as const;
513

614
export default {

.blueprint/github-build-matrix/generator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export default class extends BaseGenerator {
3030

3131
let matrix: GitHubMatrixGroup = {};
3232
let randomEnvironment = false;
33-
if (this.workflow === 'docker-compose-integration') {
34-
const { samples, warnings } = await getGithubSamplesGroup(this.templatePath('../samples/'), this.workflow);
33+
if (this.workflow === 'docker-compose-integration' || this.workflow?.startsWith('daily-builds/')) {
34+
const [group, workflow] = this.workflow.includes('/') ? this.workflow.split('/') : ['', this.workflow];
35+
const { samples, warnings } = await getGithubSamplesGroup(this.templatePath(`../samples/${group}`), workflow);
3536
matrix = samples;
3637
if (warnings.length) {
3738
this.log.warn(warnings.join('\n'));
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import type { GitHubMatrixGroup } from '../../../../lib/testing/github-matrix.ts';
2+
import { extendFilteredMatrix, fromMatrix } from '../../../../lib/testing/support/matrix-utils.ts';
3+
import { convertOptionsToJDL } from '../../support/jdl.ts';
4+
5+
export default Object.fromEntries(
6+
[
7+
...Object.entries(
8+
extendFilteredMatrix(
9+
fromMatrix({
10+
applicationType: ['monolith', 'gateway'],
11+
buildTool: ['maven', 'gradle'],
12+
reactive: [false, true],
13+
}),
14+
data => !data.reactive,
15+
{
16+
websocket: [undefined, 'spring-websocket'],
17+
},
18+
),
19+
),
20+
].map(([key, value]) => [
21+
key,
22+
{
23+
args: `jdl${value.applicationType === 'gateway' && !value.reactive ? ' --experimental' : ''}`,
24+
'cmd-frontend': './npmw run ci:frontend:test',
25+
'cmd-backend': './npmw run ci:backend:test',
26+
'cmd-e2e-1': './npmw run e2e:devserver',
27+
'cmd-e2e-2': './npmw run ci:e2e:package && npm run ci:e2e:prepare && npm run ci:e2e:run',
28+
jdl: convertOptionsToJDL(value),
29+
},
30+
]),
31+
) satisfies GitHubMatrixGroup;

.github/workflows/daily-builds.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#
2+
# Copyright the original author or authors from the JHipster project.
3+
#
4+
# This file is part of the JHipster project, see https://www.jhipster.tech/
5+
# for more information.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# https://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
name: Daily Builds
21+
on:
22+
workflow_dispatch:
23+
inputs:
24+
sample-group:
25+
type: choice
26+
description: Sample group to test
27+
options:
28+
- daily-builds/angular-webpack
29+
env:
30+
NODE_OPTIONS: --dns-result-order=ipv4first
31+
FORCE_COLOR: 2
32+
jobs:
33+
build-matrix:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
matrix: ${{ steps.build.outputs.matrix }}
37+
empty-matrix: ${{ steps.build.outputs.empty-matrix }}
38+
steps:
39+
- uses: actions/checkout@v5
40+
with:
41+
fetch-depth: 1
42+
- uses: actions/setup-node@v5
43+
with:
44+
node-version: 24
45+
- run: npm ci --ignore-scripts
46+
- id: build
47+
run: bin/jhipster.cjs github-build-matrix ${{ inputs.sample-group }}
48+
applications:
49+
name: ${{ matrix.job-name }}
50+
needs: build-matrix
51+
runs-on: ${{ matrix.os }}
52+
defaults:
53+
run:
54+
working-directory: ${{ github.workspace }}/app
55+
timeout-minutes: 40
56+
strategy:
57+
fail-fast: false
58+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
59+
steps:
60+
#----------------------------------------------------------------------
61+
# Install all tools and check configuration
62+
#----------------------------------------------------------------------
63+
- name: 'SETUP: Checkout generator-jhipster'
64+
uses: actions/checkout@v5
65+
with:
66+
path: generator-jhipster
67+
fetch-depth: 2
68+
- uses: jhipster/actions/setup-runner@v1
69+
with:
70+
node-version: ${{ matrix.node-version }}
71+
java-version: ${{ matrix.java-version }}
72+
npm-version: ${{ matrix.npm-version }}
73+
maven-cache: true
74+
gradle-cache: ${{ matrix.gradle-cache }}
75+
binary-dir: ${{ github.workspace }}/generator-jhipster/bin
76+
- run: npm ci --ignore-scripts
77+
working-directory: ${{ github.workspace }}/generator-jhipster
78+
- uses: jhipster/actions/build-jhipster-bom@v1
79+
with:
80+
jhipster-bom-ref: main
81+
- name: Generate project
82+
run: jhipster.cjs ${{ matrix.args }} --defaults
83+
env:
84+
JHIPSTER_DEPENDENCIES_VERSION: 0.0.0-CICD
85+
JHI_SKIP_JHIPSTER_DEPENDENCIES: true
86+
JHI_PROFILE: ${{ matrix.default-environment }}
87+
JHI_JDL: ${{ matrix.jdl }}
88+
- run: jhipster.cjs info
89+
- run: ${{ matrix.cmd-frontend }}
90+
id: frontend
91+
- run: ${{ matrix.cmd-backend }}
92+
id: backend
93+
- run: ${{ matrix.cmd-e2e-1 }}
94+
id: e2e-1
95+
- run: ${{ matrix.cmd-e2e-2 }}
96+
id: e2e-2
97+
- name: Upload cypress screenshots
98+
uses: actions/upload-artifact@v4
99+
if: always() && (steps.e2e-1.outcome == 'failure' || steps.e2e-2.outcome == 'failure')
100+
with:
101+
name: screenshots-${{ matrix.name }}
102+
path: ${{ github.workspace }}app//*/cypress/screenshots
103+
check-workflow:
104+
permissions:
105+
contents: none
106+
runs-on: ubuntu-latest
107+
needs: [applications]
108+
if: always()
109+
steps:
110+
- run: |
111+
echo '${{ toJSON(needs) }}'
112+
if [ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then
113+
exit 0
114+
fi
115+
exit 1

0 commit comments

Comments
 (0)