add samples #120
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 | |
# | |
# http://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: Integration Test JHipster 8 | |
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: | |
workflow_dispatch: | |
inputs: | |
storeApplication: | |
description: 'Store application' | |
default: '' | |
required: false | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
- 'skip_ci*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
applications: | |
name: jOOQ (${{ matrix.build }}, reactive ${{ matrix.reactive }}, ${{ matrix.generator-jhipster }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
working-directory: app | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
generator-jhipster: [jhipster/generator-jhipster#main] | |
build: [maven, gradle] | |
reactive: ['false', 'true'] | |
app-type: | |
- app | |
include: | |
- app-type: app | |
entity: sql | |
steps: | |
#---------------------------------------------------------------------- | |
# Install all tools and check configuration | |
#---------------------------------------------------------------------- | |
- uses: actions/checkout@v4 | |
with: | |
path: generator-jhipster-jooq | |
- uses: actions/checkout@v4 | |
with: | |
repository: jhipster/generator-jhipster | |
path: generator-jhipster | |
- name: 'SETUP: environment' | |
id: setup | |
uses: ./generator-jhipster/.github/actions/setup | |
with: | |
entities-sample: ${{ matrix.entity }} | |
jhipster-bom-branch: ignore | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.setup.outputs.node-version }} | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
#---------------------------------------------------------------------- | |
# Install JHipster and generate project+entities | |
#---------------------------------------------------------------------- | |
- name: 'GENERATION: install generator-jhipster-jooq' | |
run: | | |
npm ci --prod | |
npm link | |
working-directory: generator-jhipster-jooq | |
- name: 'GENERATION: entities' | |
run: | | |
$JHI_SCRIPTS/11-generate-config.sh | |
ls -la $JHI_FOLDER_APP/.jhipster/ | |
rm $JHI_FOLDER_APP/.jhipster/*JpaFiltering* | |
- name: 'GENERATION: project' | |
run: jhipster-jooq jdl --skip-jhipster-dependencies --no-insight --skip-checks --build ${{ matrix.build }} --inline "application { config { prodDatabaseType postgresql, buildTool ${{ matrix.build }}, reactive ${{ matrix.reactive }}, testFrameworks [cypress] } } " | |
id: app | |
#---------------------------------------------------------------------- | |
# Print package.json, if doesn't exist, it's a microservice, create it. | |
#---------------------------------------------------------------------- | |
- name: Package.json information | |
run: | | |
cat package.json || true | |
cat */package.json || true | |
- name: Project information | |
run: jhipster-jooq info | |
- name: Folder information | |
run: ls -la | |
#---------------------------------------------------------------------- | |
# Tests | |
#---------------------------------------------------------------------- | |
- name: Backend info | |
if: ${{ steps.app.outcome == 'success' && always() }} | |
run: npm run backend:info | |
id: backend_info | |
- name: Backend javadoc | |
if: ${{ steps.backend_info.outcome == 'success' && always() }} | |
run: npm run backend:doc:test | |
- name: Backend test | |
if: ${{ steps.backend_info.outcome == 'success' && always() }} | |
run: npm run ci:backend:test | |
timeout-minutes: 10 | |
- name: E2E Packaging | |
if: ${{ steps.app.outcome == 'success' && always() }} | |
run: npm run ci:e2e:package | |
id: packaging | |
timeout-minutes: 5 | |
- name: E2E Prepare | |
if: ${{ steps.packaging.outcome == 'success' && always() }} | |
run: npm run ci:e2e:prepare | |
timeout-minutes: 5 | |
- name: End-to-End | |
if: ${{ steps.packaging.outcome == 'success' && always() }} | |
run: npm run ci:e2e:run | |
timeout-minutes: 10 | |
- name: Create application archive | |
if: always() && github.event.inputs.storeApplication != '' | |
run: git archive HEAD -o archive.zip | |
- name: Upload application archive | |
uses: actions/upload-artifact@v2 | |
if: always() && github.event.inputs.storeApplication != '' | |
with: | |
name: jhipster-jooq-${{ matrix.build }}.zip | |
path: app/archive.zip | |
check-applications: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
needs: [applications] | |
if: always() | |
steps: | |
- run: | | |
echo '${{ toJSON(needs) }}' | |
if [ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then | |
exit 0 | |
fi | |
exit 1 |