Split bug report template one template for jhipster info
another for jdl. Add an incremental change/2 jdls template
#853
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
# | |
# Copyright the original author or authors from the JHipster project. | |
# | |
# This file is part of the JHipster project, see https://www.jhipster.tech/ | |
# for more information. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: Issue Check | |
on: | |
issues: | |
types: [reopened, labeled] | |
workflow_dispatch: | |
inputs: | |
issue: | |
description: 'Issue to test samples' | |
required: true | |
type: number | |
permissions: | |
contents: read | |
env: | |
FORCE_COLOR: 2 | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
if: "${{ github.event.action != 'labeled' || github.event.label.name == 'area: check' }}" | |
steps: | |
- uses: mshick/[email protected] | |
with: | |
issue: ${{ inputs.issue || github.event.issue.number }} | |
message: | | |
JHipster is [checking sample](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
application: | |
name: Check issue ${{ inputs.issue || github.event.issue.number }} | |
needs: comment | |
runs-on: 'ubuntu-20.04' | |
defaults: | |
run: | |
working-directory: ${{ github.workspace }}/app | |
timeout-minutes: 50 | |
steps: | |
#---------------------------------------------------------------------- | |
# Install all tools and check configuration | |
#---------------------------------------------------------------------- | |
- name: 'SETUP: Checkout generator-jhipster' | |
uses: actions/checkout@v4 | |
with: | |
path: generator-jhipster | |
fetch-depth: 2 | |
- name: 'SETUP: environment' | |
id: setup | |
uses: ./generator-jhipster/.github/actions/setup | |
- uses: jhipster/actions/setup-runner@v0 | |
with: | |
node-version: ${{ steps.setup.outputs.node-version }} | |
java-version: ${{ steps.setup.outputs.java-version }} | |
npm-version: ${{ steps.setup.outputs.npm-version }} | |
maven-cache: true | |
gradle-cache: true | |
#---------------------------------------------------------------------- | |
# Install JHipster and generate project+entities | |
#---------------------------------------------------------------------- | |
- name: 'GENERATION: install JHipster' | |
run: $JHI_SCRIPTS/10-install-jhipster.sh | |
- name: 'GENERATION: project' | |
id: project | |
run: jhipster from-issue ${{ inputs.issue || github.event.issue.number }} --no-code-workspace --disable-blueprints | |
- name: 'GENERATION: jhipster info' | |
run: $JHI_SCRIPTS/14-jhipster-info.sh | |
#---------------------------------------------------------------------- | |
# Launch tests | |
#---------------------------------------------------------------------- | |
- name: 'PREPARE: npm install' | |
run: npm install | |
timeout-minutes: 7 | |
- name: 'TESTS: backend' | |
id: backend | |
run: npm run ci:backend:test --if-present | |
continue-on-error: true | |
timeout-minutes: 15 | |
- name: 'TESTS: frontend' | |
id: frontend | |
run: npm run ci:frontend:test --if-present | |
continue-on-error: true | |
timeout-minutes: 15 | |
- name: 'TESTS: packaging' | |
run: npm run ci:e2e:package --if-present | |
timeout-minutes: 12 | |
- name: 'TESTS: Start docker compose containers for e2e tests' | |
run: npm run ci:e2e:prepare --if-present | |
timeout-minutes: 5 | |
- name: 'E2E: Run' | |
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' | |
with: | |
name: log-${{ inputs.issue || github.event.issue.number }} | |
path: ${{ steps.setup.outputs.application-path }}/**/test-results/**/*.xml | |
- name: 'E2E: Store failure screenshots' | |
uses: actions/upload-artifact@v4 | |
if: always() && steps.e2e.outcome == 'failure' | |
with: | |
name: screenshots-${{ inputs.issue || github.event.issue.number }} | |
path: ${{ steps.setup.outputs.application-path }}/**/cypress/screenshots | |
- name: Dump docker logs | |
if: always() | |
uses: jwalton/gh-docker-logs@v2 | |
outputs: | |
valid: ${{ steps.project.outputs.valid }} | |
yo-rc: ${{ steps.project.outputs.yo-rc }} | |
entities-jdl: ${{ steps.project.outputs.entities-jdl }} | |
application: ${{ steps.project.outputs.result }} | |
frontend-check: ${{ steps.frontend.outcome }} | |
backend-check: ${{ steps.backend.outcome }} | |
e2e-check: ${{ steps.e2e.outcome }} | |
result-comment: | |
runs-on: ubuntu-latest | |
needs: application | |
if: success() || failure() | |
permissions: | |
issues: write | |
steps: | |
- uses: actions/github-script@v7 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const issue = { owner: context.issue.owner, repo: context.issue.repo, issue_number: context.issue.number } | |
github.rest.issues.listLabelsOnIssue({...issue}).then(response => { | |
const labels = response.data | |
for (const label of labels) { | |
if (label.name == 'area: check') { | |
github.rest.issues.removeLabel({...issue, name: label.name}) | |
} | |
} | |
if (!${{ needs.application.outputs.valid }}) { | |
github.rest.issues.addLabels({...issue, labels: ['area: invalid', 'area: stale']}) | |
} | |
}) | |
- uses: mshick/[email protected] | |
with: | |
issue: ${{ inputs.issue || github.event.issue.number }} | |
message: | | |
JHipster has completed the [sample check](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
`.yo-rc.json`: ${{ needs.application.outputs.yo-rc }} | |
Entities JDL: ${{ needs.application.outputs.entities-jdl }} | |
Application: ${{ needs.application.outputs.application }} | |
Frontend check: ${{ needs.application.outputs.frontend-check }} | |
Backend check: ${{ needs.application.outputs.backend-check }} | |
E2E check: ${{ needs.application.outputs.e2e-check }} | |
This check uses `jhipster info` output from the issue description to generate the sample. | |
Bug report that does not contain this information will be marked as invalid. |