Skip to content

Commit

Permalink
continue migration to jhipster/actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Apr 15, 2024
1 parent 466ed39 commit c406a59
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-matrix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
node-version: 20.12.2
node-version: 20
- name: 'Check changes'
id: build-changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/compare-base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

name: 'Generate application using merge base commit to compare'
name: 'Deprecated: Generate application using merge base commit to compare'
description: 'Experimental generate application using merge base commit to compare action'
inputs:
application-path:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/compare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

name: 'Compare generated applications'
name: 'Deprecated: Compare generated applications'
description: 'Experimental compare generated applications action'
inputs:
application-path:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/generate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

name: 'Generate'
name: 'Deprecated: Generate'
description: 'Generate application for test-integration scripts'
inputs:
extra-args:
Expand Down
20 changes: 18 additions & 2 deletions .github/actions/setup-default-node-java/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,29 @@

name: Setup default Node and Java
description: Setup default Node and Java
inputs:
generator-path:
description: 'path to the generator-jhipster repository relative to workspace'
default: generator-jhipster
java-version:
description: 'Java version'
required: true
default: '11'
runs:
using: composite
steps:
- run: |
source "${{ github.workspace }}/${{ inputs.generator-path }}/test-integration/scripts/00-init-env.sh"
echo "java-version=$JHI_JDK" >> $GITHUB_OUTPUT
echo "node-version=$JHI_NODE_VERSION" >> $GITHUB_OUTPUT
echo "npm-version=$JHI_NPM_VERSION" >> $GITHUB_OUTPUT
shell: bash
id: setup
- uses: actions/setup-node@v4
with:
node-version: 18.19.0
node-version: ${{ steps.setup.outputs.node-version }}
- run: npm install -g npm@${{ steps.setup.outputs.npm-version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: ${{ steps.setup.outputs.node-version }}
10 changes: 7 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

name: 'Setup environment'
name: 'Deprecated: Setup environment'
description: 'Setup environment for test-integration scripts'
inputs:
application-path:
Expand Down Expand Up @@ -59,7 +59,6 @@ inputs:
generator-jhipster-branch:
description: 'JHipster Generator branch'
required: false
default: main
jhipster-bom-repository:
description: 'JHipster BOM repository'
required: false
Expand Down Expand Up @@ -123,7 +122,6 @@ runs:
echo "JHI_LIB_BRANCH=${{inputs.jhipster-bom-branch}}" >> $GITHUB_ENV
echo "JHI_LIB_HOME=${{inputs.jhipster-bom-directory}}" >> $GITHUB_ENV
echo "JHI_GEN_REPO=${{inputs.generator-jhipster-repository}}" >> $GITHUB_ENV
echo "JHI_GEN_BRANCH=${{inputs.generator-jhipster-branch}}" >> $GITHUB_ENV
echo "JHI_FOLDER_APP=${{inputs.application-path}}" >> $GITHUB_ENV
echo "JHI_JDL_APP=${{ inputs.jdl-sample }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -153,6 +151,12 @@ runs:
fi
echo "JHI_PROJECT_VERSION=$JHI_PROJECT_VERSION" >> $GITHUB_ENV
if [[ "${{inputs.jhipster-bom-branch}}" != "" ]]; then
echo "JHI_GEN_BRANCH=${{inputs.generator-jhipster-branch}}" >> $GITHUB_ENV
else
echo "JHI_GEN_BRANCH=${JHI_GEN_BRANCH}" >> $GITHUB_ENV
fi
if [[ "${{inputs.jhipster-bom-branch}}" != "release" && "${{inputs.jhipster-bom-branch}}" != "ignore" ]]; then
echo "JHIPSTER_DEPENDENCIES_VERSION=0.0.0-CICD" >> $GITHUB_ENV
fi
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/devserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,11 @@ jobs:
jdl-sample: ${{ matrix.setup-jdl-sample }}
application-environment: ${{ matrix.setup-application-environment }}
application-packaging: ${{ matrix.setup-application-packaging }}
- uses: actions/setup-node@v4
- uses: jhipster/actions/setup-runner@v0
with:
node-version: ${{ steps.setup.outputs.node-version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ steps.setup.outputs.java-version }}
- uses: jhipster/actions/restore-cache@v0
with:
npm: true
maven: true
gradle: ${{ matrix.workspaces == 'true' || matrix.gradle == 1 || contains(matrix.name, 'gradle') }}
- name: 'TOOLS: configure tools installed by the system'
run: $JHI_SCRIPTS/03-system.sh
- name: 'TOOLS: configure git'
run: $JHI_SCRIPTS/04-git-config.sh
maven-cache: true
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/generator-database-changelog-liquibase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,11 @@ jobs:
entities-sample: ${{ matrix.entity }}
application-environment: ${{ matrix.environment }}
application-packaging: ${{ (matrix.war == 1 && 'war') || 'jar' }}
- uses: actions/setup-node@v4
- uses: jhipster/actions/setup-runner@v0
with:
node-version: ${{ steps.setup.outputs.node-version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ steps.setup.outputs.java-version }}
- uses: jhipster/actions/restore-cache@v0
with:
npm: true
maven: true
gradle: ${{ matrix.workspaces == 'true' || matrix.gradle == 1 || contains(matrix.name, 'gradle') }}
- name: 'TOOLS: configure tools installed by the system'
run: $JHI_SCRIPTS/03-system.sh
- name: 'TOOLS: configure git'
run: $JHI_SCRIPTS/04-git-config.sh
maven-cache: true
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/generator-generate-blueprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ jobs:
with:
application-sample: ng-default
executable: jhipster-foo
- uses: actions/setup-node@v4
- uses: jhipster/actions/setup-runner@v0
with:
node-version: ${{ steps.setup.outputs.node-version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ steps.setup.outputs.java-version }}
- uses: jhipster/actions/restore-cache@v0
with:
npm: true
maven: true
- name: 'TOOLS: configure tools installed by the system'
run: $JHI_SCRIPTS/03-system.sh
- name: 'TOOLS: configure git'
run: $JHI_SCRIPTS/04-git-config.sh
maven-cache: true
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
Expand Down
19 changes: 3 additions & 16 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,12 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: ./.github/actions/setup-default-node-java
with:
node-version: 20.12.2
- name: 'SETUP: load npm cache'
uses: actions/cache/restore@v4
with:
path: |
~/.npm
~/.cache/Cypress/
key: ${{ runner.os }}-node-
- name: 'install required npm version'
run: npm install -g npm@$(node -e "console.log(require('./generators/common/resources/package.json').devDependencies.npm);")
generator-path: '.'
- uses: jhipster/actions/setup-runner@v0
- run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit
shell: bash
- name: Config git variables
env:
JHI_SCRIPTS: ./test-integration/scripts
run: $JHI_SCRIPTS/04-git-config.sh
shell: bash
- run: npm ci
- run: npm run prettier:check
- run: npm test
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/issue-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,13 @@ jobs:
- name: 'SETUP: environment'
id: setup
uses: ./generator-jhipster/.github/actions/setup
- uses: actions/setup-node@v4
- uses: jhipster/actions/setup-runner@v0
with:
node-version: ${{ steps.setup.outputs.node-version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ steps.setup.outputs.java-version }}
- uses: jhipster/actions/restore-cache@v0
with:
npm: true
maven: true
gradle: true
- name: 'TOOLS: configure tools installed by the system'
run: $JHI_SCRIPTS/03-system.sh
- name: 'TOOLS: configure git'
run: $JHI_SCRIPTS/04-git-config.sh
- name: 'Install required NPM version'
run: npm install -g npm@${{ steps.setup.outputs.npm-version }} || true
npm-version: ${{ steps.setup.outputs.npm-version }}
maven-cache: true
gradle-cache: true
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/linked-issue-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ jobs:
id: setup
uses: ./generator-jhipster/.github/actions/setup
- uses: ./generator-jhipster/.github/actions/setup-default-node-java
- uses: jhipster/actions/create-app-path@v0
- uses: jhipster/actions/setup-keycloak-hostname@v0
- uses: jhipster/actions/setup-git@v0
- uses: jhipster/actions/restore-cache@v0
- uses: jhipster/actions/setup-runner@v0
with:
npm: true
maven: true
gradle: true
maven-cache: true
gradle-cache: true
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/lock-maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,16 @@ jobs:
if: github.repository == 'jhipster/generator-jhipster'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g npm@latest
- uses: actions/checkout@v4
- uses: jhipster/actions/restore-cache@v0
- uses: ./.github/actions/setup-default-node-java
with:
npm: true
generator-path: '.'
- uses: jhipster/actions/setup-runner@v0
- name: Create commit
run: |
rm package-lock.json
npm install || npm install --force
git add .
./test-integration/scripts/04-git-config.sh
git commit -a -m "Bump transitional dependencies" || true
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand Down
3 changes: 3 additions & 0 deletions test-integration/scripts/00-init-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,8 @@ JHI_NODE_VERSION=$(cat $JHI_HOME/generators/init/resources/.node-version)
# npm version
JHI_NPM_VERSION=$(grep -o '"npm": "[^"]*"' $JHI_HOME/generators/common/resources/package.json | cut -f4 -d '"')

# npm version
JHI_GEN_BRANCH=$(grep -o "JHIPSTER_BOM_BRANCH = '[^']*'" $JHI_HOME/test-integration/integration-test-constants.js | cut -f2 -d "'")

# generator-jhipster version
JHI_VERSION=$(grep -o '"version": "[^"]*"' $JHI_HOME/package.json | cut -f4 -d '"')
6 changes: 4 additions & 2 deletions test-integration/scripts/99-write-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ writeFileSync(
'setup-entities-sample': sample.entity ?? 'none',
'setup-jdl-entities-sample': sample['jdl-entity'] ?? '',
'setup-jdl-sample': sample['jdl-samples'] ?? '',
java: JAVA_VERSION,
node: NODE_VERSION,
java: sample['java-version'] ?? JAVA_VERSION,
node: sample['node-version'] ?? NODE_VERSION,
'java-version': JAVA_VERSION,
'node-version': NODE_VERSION,
'npm-version': generatorOptions?.workspaces ? NPM_VERSION : undefined,
'build-jhipster-bom': BUILD_JHIPSTER_BOM,
'jhipster-bom-branch': BUILD_JHIPSTER_BOM ? JHIPSTER_BOM_BRANCH : undefined,
Expand Down
Loading

0 comments on commit c406a59

Please sign in to comment.