-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24185 from mshima/skip_ci-shared-actions
Use shared actions for caching
- Loading branch information
Showing
16 changed files
with
261 additions
and
277 deletions.
There are no files selected for viewing
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright 2013-2023 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: Build cache | ||
description: Build cache | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: jhipster/actions/cache-npm-dependencies@v0 | ||
if: always() | ||
with: | ||
generator-path: generator-jhipster | ||
generator-jhipster-path: generator-jhipster | ||
- uses: ./generator-jhipster/.github/actions/cache-java-dependencies | ||
if: always() | ||
with: | ||
jhipster-bom-path: jhipster-bom | ||
generator-jhipster-path: generator-jhipster | ||
- uses: jhipster/actions/save-cache@v0 | ||
if: always() | ||
with: | ||
key: -${{ github.run_id }} | ||
npm: true | ||
maven: true | ||
gradle: true | ||
- uses: jhipster/actions/restore-cache@v0 | ||
if: always() | ||
with: | ||
npm: true | ||
maven: true | ||
gradle: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# | ||
# Copyright 2013-2023 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: Cache java dependencies | ||
description: Cache java dependencies | ||
inputs: | ||
generator-jhipster-path: | ||
description: JHipster generator folder relative to workspace. | ||
required: false | ||
jhipster-bom-path: | ||
description: JHipster bom folder relative to workspace. | ||
required: false | ||
runs: | ||
using: composite | ||
steps: | ||
- name: 'mvn: install JHipster' | ||
run: | | ||
echo "::group::jhipster-bom" | ||
./mvnw dependency:go-offline --ntp | ||
echo "::endgroup::" | ||
if: always() && inputs.jhipster-bom-path | ||
shell: bash | ||
working-directory: ${{ github.workspace }}/${{ inputs.jhipster-bom-path }} | ||
- run: rm -rf tmp; mkdir tmp | ||
shell: bash | ||
working-directory: ${{ github.workspace }} | ||
- name: 'mvn(imperative): cache dependencies' | ||
run: | | ||
echo "::group::maven(imperative)" | ||
${{ github.workspace }}/${{ inputs.generator-jhipster-path }}/bin/jhipster.cjs generate-sample cache.jdl --skip-install --workspaces | ||
npm run backend:build-cache -- --ntp || true | ||
cd app1 | ||
./npmw -v | ||
echo "::endgroup::" | ||
shell: bash | ||
if: always() | ||
working-directory: ${{ github.workspace }}/tmp | ||
- run: rm -rf tmp; mkdir tmp | ||
shell: bash | ||
working-directory: ${{ github.workspace }} | ||
- name: 'mvn(reactive): cache dependencies' | ||
run: | | ||
echo "::group::maven(reactive)" | ||
${{ github.workspace }}/${{ inputs.generator-jhipster-path }}/bin/jhipster.cjs generate-sample cache.jdl --skip-install --skip-install --workspaces --reactive | ||
npm install --force | ||
npm run backend:build-cache -- --ntp || true | ||
echo "::endgroup::" | ||
shell: bash | ||
if: always() | ||
working-directory: ${{ github.workspace }}/tmp | ||
- run: rm -rf tmp; mkdir tmp | ||
shell: bash | ||
working-directory: ${{ github.workspace }} | ||
- name: 'gradle(imperative): cache dependencies' | ||
run: | | ||
echo "::group::gradle(imperative)" | ||
${{ github.workspace }}/${{ inputs.generator-jhipster-path }}/bin/jhipster.cjs generate-sample cache.jdl --skip-install --skip-install --workspaces --build gradle | ||
npm install --force | ||
npm run backend:build-cache || true | ||
cd app1 | ||
./npmw -v | ||
echo "::endgroup::" | ||
shell: bash | ||
if: always() | ||
working-directory: ${{ github.workspace }}/tmp | ||
- run: rm -rf tmp; mkdir tmp | ||
shell: bash | ||
working-directory: ${{ github.workspace }} | ||
- name: 'gradle(reactive): cache dependencies' | ||
run: | | ||
echo "::group::gradle(reactive)" | ||
${{ github.workspace }}/${{ inputs.generator-jhipster-path }}/bin/jhipster.cjs generate-sample cache.jdl --skip-install --skip-install --workspaces --build gradle --reactive | ||
npm install --force | ||
npm run backend:build-cache || true | ||
echo "::endgroup::" | ||
shell: bash | ||
if: always() | ||
working-directory: ${{ github.workspace }}/tmp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# Copyright 2013-2023 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: Setup default Node and Java | ||
description: Setup default Node and Java | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright 2013-2023 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: Setup generator-jhipster jit | ||
description: Make generator-jhipster jit executable available globally as jh | ||
inputs: | ||
generator-path: | ||
description: Generator folder relative to workspace, git checkout, npm remove, install, and link will be executed in the folder. | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Link executable | ||
shell: bash | ||
run: | | ||
set -x | ||
npm install | ||
mkdir -p "${HOME}/.bin" | ||
echo "${HOME}/.bin" >> $GITHUB_PATH | ||
ln -s "${{ github.workspace }}/${{ inputs.generator-path }}/bin/jhipster.cjs" "${HOME}/.bin/jh" | ||
ls -la "${HOME}/.bin/jh" | ||
"${{ github.workspace }}/${{ inputs.generator-path }}/bin/jhipster.cjs" --install-path | ||
working-directory: ${{ github.workspace }}/${{ inputs.generator-path }} |
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
Oops, something went wrong.