Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement new cli and remove generator-jhipster usage in ci #381

Merged
merged 10 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 51 additions & 56 deletions .github/actions/compare-base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,61 +20,56 @@
name: 'Generate application using merge base commit to compare'
description: 'Experimental generate application using merge base commit to compare action'
inputs:
application-path:
description: 'Application path'
required: false
default: ${{ github.workspace }}/base/app
extra-args:
description: 'Extra arguments'
required: false
default: ''
application-path:
description: 'Application path'
required: false
default: ${{ github.workspace }}/base/app
extra-args:
description: 'Extra arguments'
required: false
default: ''
outputs:
application-path:
description: 'Application path'
value: ${{ steps.base.outputs.application-path }}
application-path:
description: 'Application path'
value: ${{ steps.base.outputs.application-path }}
runs:
using: 'composite'
steps:
- name: 'MERGE: Install base generator-jhipster'
run: |
if [[ "$JHI_CLI_PACKAGE" == "" ]]; then
JHI_CLI_PACKAGE=generator-jhipster
fi
mkdir -p "${{ github.workspace }}/base/$JHI_CLI_PACKAGE"
cd "${{ github.workspace }}/base/$JHI_CLI_PACKAGE"
git clone "${{ github.workspace }}/$JHI_CLI_PACKAGE" .
git checkout @~1
git log
npm uninstall -g $JHI_CLI_PACKAGE
npm install
npm install -g .
shell: bash
- name: 'MERGE: merge base config'
id: base-config
run: $JHI_SCRIPTS/11-generate-config.sh
env:
JHI_FOLDER_APP: ${{ inputs.application-path }}
shell: bash
- name: 'MERGE: quirks'
id: quirks
run: |
# docker-compose is not reproducible, copy old config
ls "$JHI_FOLDER_APP/docker-compose" \
&& mkdir "${{ inputs.application-path }}/docker-compose" \
&& cp "$JHI_FOLDER_APP/docker-compose"/.yo-rc.json "${{ inputs.application-path }}/docker-compose" \
|| true
shell: bash
- name: 'MERGE: merge base project'
id: base
run: |
$JHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies --skip-install --skip-git ${{ inputs.extra-args }}
echo "::set-output name=application-path::${{inputs.application-path}}"
env:
JHI_FOLDER_APP: ${{ inputs.application-path }}
JHI_JDL_SAMPLES: "${{ github.workspace }}/base/${{ env.JHI_CLI_PACKAGE || 'generator-jhipster' }}/test-integration/jdl-samples"
shell: bash
- name: 'MERGE: merge base git'
run: |
# Copy git repository (clone without the files)
cp -a "$JHI_FOLDER_APP/.git" "${{ inputs.application-path }}"
shell: bash
using: 'composite'
steps:
- name: 'MERGE: Install base generator-jhipster'
run: |
cd "${{ github.workspace }}/jhipster-kotlin"
git restore -s @~1 .
npm install
# use updated cli, scripts and samples
git checkout cli/cli.cjs test-integration
shell: bash
- name: 'MERGE: merge base config'
id: base-config
run: $KHI_SCRIPTS/11-generate-config.sh
env:
JHI_FOLDER_APP: ${{ inputs.application-path }}
KHI_FOLDER_APP: ${{ inputs.application-path }}
shell: bash
- name: 'MERGE: quirks'
id: quirks
run: |
# docker-compose is not reproducible, copy old config
ls "${{ github.workspace }}/app//docker-compose" \
&& mkdir "${{ inputs.application-path }}/docker-compose" \
&& cp "${{ github.workspace }}/app/docker-compose"/.yo-rc.json "${{ inputs.application-path }}/docker-compose" \
|| true
shell: bash
- name: 'MERGE: merge base project'
id: base
run: |
$KHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies --skip-install --skip-git ${{ inputs.extra-args }}
echo "::set-output name=application-path::${{inputs.application-path}}"
env:
JHI_FOLDER_APP: ${{ inputs.application-path }}
KHI_FOLDER_APP: ${{ inputs.application-path }}
shell: bash
- name: 'MERGE: merge base git'
run: |
# Copy git repository (clone without the files)
cp -a "${{ github.workspace }}/app/.git" "${{ inputs.application-path }}"
shell: bash
56 changes: 28 additions & 28 deletions .github/actions/compare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@
name: 'Compare generated applications'
description: 'Experimental compare generated applications action'
inputs:
application-path:
description: 'Application path'
required: false
default: ${{ github.workspace }}/base/app
application-path:
description: 'Application path'
required: false
default: ${{ github.workspace }}/base/app
outputs:
equals:
description: "Generated source didn't changed"
value: ${{ steps.compare.outputs.equals }}
has-changes:
description: 'Generated source has changed'
value: ${{ steps.compare.outputs.has-changes }}
equals:
description: "Generated source didn't changed"
value: ${{ steps.compare.outputs.equals }}
has-changes:
description: 'Generated source has changed'
value: ${{ steps.compare.outputs.has-changes }}
runs:
using: 'composite'
steps:
- name: 'MERGE: merge project diff'
id: compare
working-directory: ${{inputs.application-path}}
run: |
git log
# File keystore.p12 always changes
# File package-lock.json is not generated
# Verify if the generated source has changed
git add .
echo "Showing config diff changes (won't trigger builds)"
git -c color.ui=always diff -R --cached -- '.yo-rc.json' '**/.yo-rc.json' '.jhipster/**' '**/.jhipster/**'
echo "Showing source diff changes (will trigger builds)"
git -c color.ui=always diff -R --cached --exit-code -- . ':!.yo-rc.json' ':!**/.yo-rc.json' ':!.jhipster/**' ':!**/.jhipster/**' ':!package-lock.json' ':!**/package-lock.json' ':!**/keystore.p12' \
&& echo "::set-output name=equals::true" \
|| echo "::set-output name=has-changes::true"
shell: bash
using: 'composite'
steps:
- name: 'MERGE: merge project diff'
id: compare
working-directory: ${{inputs.application-path}}
run: |
git log
# File keystore.p12 always changes
# File package-lock.json is not generated
# Verify if the generated source has changed
git add .
echo "Showing config diff changes (won't trigger builds)"
git -c color.ui=always diff -R --cached -- '.yo-rc.json' '**/.yo-rc.json' '.jhipster/**' '**/.jhipster/**'
echo "Showing source diff changes (will trigger builds)"
git -c color.ui=always diff -R --cached --exit-code -- . ':!.yo-rc.json' ':!**/.yo-rc.json' ':!.jhipster/**' ':!**/.jhipster/**' ':!package-lock.json' ':!**/package-lock.json' ':!**/keystore.p12' \
&& echo "::set-output name=equals::true" \
|| echo "::set-output name=has-changes::true"
shell: bash
27 changes: 12 additions & 15 deletions .github/actions/generate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@
name: 'Generate'
description: 'Generate application for test-integration scripts'
inputs:
extra-args:
description: 'Extra arguments'
required: false
default: ''
extra-args:
description: 'Extra arguments'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: 'GENERATION: install executable'
run: $JHI_SCRIPTS/10-install-jhipster.sh
shell: bash
- name: 'GENERATION: generate config'
run: $JHI_SCRIPTS/11-generate-config.sh
shell: bash
- name: 'GENERATION: project'
run: $JHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies ${{ inputs.extra-args }}
shell: bash
using: 'composite'
steps:
- name: 'GENERATION: generate config'
run: $KHI_SCRIPTS/11-generate-config.sh
shell: bash
- name: 'GENERATION: project'
run: $KHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies ${{ inputs.extra-args }}
shell: bash
8 changes: 4 additions & 4 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ inputs:
executable:
description: 'Executable'
required: false
default: khipster
default: cli.cjs
outputs:
java-version:
description: 'Java version'
Expand Down Expand Up @@ -123,7 +123,7 @@ runs:
echo "KHI_INTEG=$KHI_INTEG" >> $GITHUB_ENV
echo "KHI_SCRIPTS=$KHI_SCRIPTS" >> $GITHUB_ENV
echo "KHI_HOME=$KHI_HOME" >> $GITHUB_ENV
echo "JHI_SCRIPTS=$JHI_SCRIPTS" >> $GITHUB_ENV
echo "KHI_SCRIPTS=$KHI_SCRIPTS" >> $GITHUB_ENV
echo "KHI_CLI_PACKAGE_PATH=$KHI_CLI_PACKAGE_PATH" >> $GITHUB_ENV
echo "KHI_CLI_PACKAGE=$KHI_CLI_PACKAGE" >> $GITHUB_ENV
echo "JHI_INTEG=$JHI_INTEG" >> $GITHUB_ENV
Expand Down Expand Up @@ -185,11 +185,11 @@ runs:
echo "=============================="
shell: bash
- name: 'ENV: display variables'
run: $JHI_SCRIPTS/01-display-configuration.sh
run: $KHI_SCRIPTS/01-display-configuration.sh
shell: bash
- name: 'SETUP: Create required structure'
run: mkdir -p $KHI_FOLDER_APP
shell: bash
- name: 'SETUP: configure git'
run: $JHI_SCRIPTS/04-git-config.sh
run: $KHI_SCRIPTS/04-git-config.sh
shell: bash
Loading
Loading