Skip to content

Commit

Permalink
check for existing sample at closing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jan 4, 2024
1 parent 099085b commit 6fa2912
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .blueprint/from-issue/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const YO_RC_OUTPUT = 'yo-rc';
const ENTITIES_JDL_OUTPUT = 'entities-jdl';
const RESULT_OUTPUT = 'result';
const VALID_OUTPUT = 'valid';
const CONTAINS_SAMPLE = 'contains-sample';

const BLANK = 'blank';
const VALID = 'valid';
Expand Down Expand Up @@ -70,8 +71,10 @@ export default class extends BaseGenerator {

const regexp = /<summary>(?<title>(?:(?!<\/summary>).)+)<\/summary>\s+<pre>(?<body>(?:(?!<\/pre>).)+)/gs;
let match;
let containsSample = false;
let valid = false;
while ((match = regexp.exec(issue.data.body)) !== null) {
containsSample = true;
if (match.groups.title.includes('.yo-rc.json file')) {
try {
if (match.groups.body) {
Expand All @@ -90,6 +93,7 @@ export default class extends BaseGenerator {
setOutput(ENTITIES_JDL_OUTPUT, this.jdlEntities ? VALID : BLANK);
}
}
setOutput(CONTAINS_SAMPLE, containsSample);
setOutput(VALID_OUTPUT, valid);

this.projectFolder = this.projectFolder ?? join(this._globalConfig.get('samplesFolder'), `issues/${this.issue}`);
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/linked-issue-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,45 +81,52 @@ jobs:
id: project
run: jhipster from-issue "${{ matrix.linked-issue }}" --no-code-workspace --disable-blueprints
- name: 'GENERATION: jhipster info'
if: steps.project.outputs.contains-sample != 'false'
run: $JHI_SCRIPTS/14-jhipster-info.sh
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- name: 'PREPARE: npm install'
if: steps.project.outputs.contains-sample != 'false'
run: npm install
timeout-minutes: 7
- name: 'TESTS: backend'
if: steps.project.outputs.contains-sample != 'false'
id: backend
run: npm run ci:backend:test --if-present
timeout-minutes: 15
- name: 'TESTS: frontend'
if: steps.project.outputs.contains-sample != 'false'
id: frontend
run: npm run ci:frontend:test --if-present
timeout-minutes: 15
- name: 'TESTS: packaging'
if: steps.project.outputs.contains-sample != 'false'
run: npm run ci:e2e:package --if-present
timeout-minutes: 12
- name: 'TESTS: Start docker compose containers for e2e tests'
if: steps.project.outputs.contains-sample != 'false'
run: npm run ci:e2e:prepare --if-present
timeout-minutes: 5
- name: 'E2E: Run'
if: steps.project.outputs.contains-sample != 'false'
id: e2e
run: npm run ci:e2e:run --if-present
timeout-minutes: 15
- name: 'BACKEND: Store failure logs'
uses: actions/upload-artifact@v4
if: always() && steps.backend.outcome == 'failure'
if: always() && steps.backend.outcome == 'failure' && steps.project.outputs.contains-sample != 'false'
with:
name: log-${{ matrix.number }}
path: app/**/test-results/**/*.xml
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v4
if: always() && steps.e2e.outcome == 'failure'
if: always() && steps.e2e.outcome == 'failure' && steps.project.outputs.contains-sample != 'false'
with:
name: screenshots-${{ matrix.number }}
path: app/**/cypress/screenshots
- name: Dump docker logs
if: always()
if: always() && steps.project.outputs.contains-sample != 'false'
uses: jwalton/gh-docker-logs@v2
check-closing-issues:
permissions:
Expand Down

0 comments on commit 6fa2912

Please sign in to comment.