Skip to content

Commit

Permalink
workflow adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jun 18, 2024
1 parent 829ad83 commit 0b10ddf
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/actions/compare-base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
git restore -s @~1 .
npm install
# use updated cli, scripts and samples
git checkout cli/cli.cjs test-integration
git checkout test-integration/scripts
shell: bash
- name: 'MERGE: merge base config'
id: base-config
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/compare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ runs:
# 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/**'
git -c color.ui=always diff -R --cached -- '.yo-rc.json' '**/.yo-rc.json' '.jhipster/**' '**/.jhipster/**' '**.jdl' '**.md' 'kubernetes/**'
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' \
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' '!**.jdl' '!**.md' '!kubernetes/**' \
&& echo "::set-output name=equals::true" \
|| echo "::set-output name=has-changes::true"
shell: bash
14 changes: 9 additions & 5 deletions .github/workflows/angular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ jobs:
#----------------------------------------------------------------------
# Detect changes against base commit
#----------------------------------------------------------------------
# Revert samples rename to old name.
- run: echo "JHI_JDL_APP=${JHI_JDL_APP//ng-oauth2-mongodb/ng-oauth2-eureka-mongodb}" >> $GITHUB_ENV
- run: echo "JHI_JDL_APP=${JHI_JDL_APP//ng-/ngx-}" >> $GITHUB_ENV
- run: echo "JHI_APP=${JHI_APP//ng-/ngx-}" >> $GITHUB_ENV
- name: 'MERGE: generate base'
continue-on-error: true
id: base-app
Expand Down Expand Up @@ -151,10 +155,10 @@ jobs:
run: npm run ci:backend:test
continue-on-error: ${{matrix.continue-on-backend-tests-error || false}}
timeout-minutes: 20
- name: 'TESTS: frontend'
if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 && needs.build-matrix.outputs.client != 'false'
run: npm run ci:frontend:test
timeout-minutes: 8
#- name: 'TESTS: frontend'
# if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 && needs.build-matrix.outputs.client != 'false'
# run: npm run ci:frontend:test
# timeout-minutes: 8
- name: 'TESTS: packaging'
if: steps.compare.outputs.equals != 'true'
run: npm run ci:e2e:package
Expand All @@ -173,7 +177,7 @@ jobs:
if: always() && steps.backend.outcome == 'failure'
with:
name: log-${{ matrix.name }}
path: ${{ steps.setup.outputs.application-path }}/**/test-results/**/*.xml
path: ${{ steps.setup.outputs.application-path }}/**/reports/ktlint/**
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v3
if: always() && steps.e2e.outcome == 'failure'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ jobs:
run: npm run ci:backend:test
continue-on-error: ${{matrix.continue-on-backend-tests-error || false}}
timeout-minutes: 20
- name: 'TESTS: frontend'
if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 && needs.build-matrix.outputs.client != 'false'
run: npm run ci:frontend:test
timeout-minutes: 8
#- name: 'TESTS: frontend'
# if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 && needs.build-matrix.outputs.client != 'false'
# run: npm run ci:frontend:test
# timeout-minutes: 8
- name: 'TESTS: packaging'
if: steps.compare.outputs.equals != 'true'
run: npm run ci:e2e:package
Expand All @@ -170,7 +170,7 @@ jobs:
if: always() && steps.backend.outcome == 'failure'
with:
name: log-${{ matrix.name }}
path: ${{ steps.setup.outputs.application-path }}/**/test-results/**/*.xml
path: ${{ steps.setup.outputs.application-path }}/**/reports/ktlint/**
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v3
if: always() && steps.e2e.outcome == 'failure'
Expand Down
15 changes: 13 additions & 2 deletions test-integration/scripts/11-generate-config.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#-------------------------------------------------------------------------------
# Eg: 11-generate-config.sh ./ ngx-default sqlfull
# Eg: 11-generate-config.sh ./ ng-default sqlfull
#-------------------------------------------------------------------------------
if [[ "$1" != "" ]]; then
KHI_FOLDER_APP=$1
Expand Down Expand Up @@ -189,7 +189,18 @@ fi
# Generate jdl entities
#-------------------------------------------------------------------------------
if [[ "$JHI_JDL_ENTITY" != "" && "$JHI_JDL_ENTITY" != "none" ]]; then
cli.cjs --no-insight jdl "$JHI_SAMPLES"/jdl-entities/$JHI_JDL_ENTITY.jdl --json-only
IFS=','
for i in `echo "$JHI_JDL_ENTITY"`
do
if [[ -d "$JHI_SAMPLES/jdl-entities/$i" ]]; then
cli.cjs --no-insight jdl "$JHI_SAMPLES"/jdl-entities/$i --json-only

elif [[ -f "$JHI_SAMPLES/jdl-entities/$i.jdl" ]]; then
cp -f "$JHI_SAMPLES/jdl-entities/$i.jdl" "$KHI_FOLDER_APP"/
cli.cjs --no-insight jdl "$JHI_SAMPLES"/jdl-entities/$i.jdl --json-only

fi
done
fi

#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion test-integration/scripts/25-sonar-analyze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source $(dirname $0)/00-init-env.sh
#--------------------------------------------------
cd "$KHI_FOLDER_APP"

if [[ "$JHI_APP" = "ngx-default" && "$GITHUB_REPOSITORY" = "jhipster/generator-jhipster" && "$GITHUB_REF" = "refs/heads/main" ]]; then
if [[ "$JHI_APP" = "ng-default" && "$GITHUB_REPOSITORY" = "jhipster/generator-jhipster" && "$GITHUB_REF" = "refs/heads/main" ]]; then
echo "*** Sonar analyze for main branch"
./mvnw -ntp --batch-mode initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
Expand Down
46 changes: 23 additions & 23 deletions test-integration/workflow-samples/angular.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
{
"include": [
{
"name": "ngx-default",
"app-sample": "ngx-default",
"name": "ng-default",
"app-sample": "ng-default",
"entity": "sqlfull",
"sonar-analyse": "true"
},
{
"name": "ngx-default-additional",
"name": "ng-default-additional",
"entity": "none",
"app-sample": "ngx-default",
"jdl-entity": "*"
"app-sample": "ng-default",
"jdl-entity": "custom-id,entities"
},
{
"name": "ngx-mongodb-kafka-cucumber",
"app-sample": "ngx-mongodb-kafka-cucumber",
"name": "ng-mongodb-kafka-cucumber",
"app-sample": "ng-mongodb-kafka-cucumber",
"entity": "mongodb",
"environment": "dev"
},
{
"name": "ngx-gradle-fr",
"app-sample": "ngx-gradle-fr",
"name": "ng-gradle-fr",
"app-sample": "ng-gradle-fr",
"entity": "sql"
},
{
"name": "ngx-gradle-h2disk-ws-nocache",
"app-sample": "ngx-gradle-h2disk-ws-nocache",
"name": "ng-gradle-h2disk-ws-nocache",
"app-sample": "ng-gradle-h2disk-ws-nocache",
"entity": "sql",
"environment": "dev",
"war": 1,
"testcontainers": "false"
},
{
"name": "ngx-webflux-mongodb",
"name": "ng-webflux-mongodb",
"app-sample": "webflux-mongodb",
"entity": "mongodb"
},
{
"name": "ngx-webflux-gradle-mongodb-oauth2",
"name": "ng-webflux-gradle-mongodb-oauth2",
"app-sample": "webflux-mongodb-oauth2",
"entity": "mongodb"
},
{
"name": "ngx-webflux-psql-default",
"name": "ng-webflux-psql-default",
"app-sample": "webflux-psql",
"entity": "sql"
},
{
"name": "ngx-webflux-psql-additional",
"name": "ng-webflux-psql-additional",
"jdl-samples": "webflux-psql,custom-domain"
},
{
"name": "ngx-webflux-gradle-session-h2mem-es",
"name": "ng-webflux-gradle-session-h2mem-es",
"app-sample": "webflux-gradle-session-h2mem-es",
"environment": "dev",
"entity": "sqllight"
},
{
"name": "ngx-webflux-couchbase",
"name": "ng-webflux-couchbase",
"app-sample": "webflux-couchbase",
"entity": "couchbase"
},
{
"name": "ms-ngx-eureka-oauth2-mongodb-caffeine",
"jdl-samples": "ms-ngx-eureka-oauth2-mongodb-caffeine",
"name": "ms-ng-oauth2-mongodb-caffeine",
"jdl-samples": "ms-ng-oauth2-mongodb-caffeine",
"extra-args": "--workspaces --monorepository",
"workspaces": "true"
},
{
"name": "mf-ngx-eureka-jwt-psql-ehcache",
"jdl-samples": "mf-ngx-eureka-jwt-psql-ehcache",
"name": "mf-ng-eureka-jwt-psql-ehcache",
"jdl-samples": "mf-ng-eureka-jwt-psql-ehcache",
"extra-args": "--workspaces --monorepository",
"workspaces": "true"
},
{
"name": "ms-mf-ngx-consul-oauth2-neo4j",
"jdl-samples": "ms-mf-ngx-consul-oauth2-neo4j",
"name": "ms-mf-ng-consul-oauth2-neo4j",
"jdl-samples": "ms-mf-ng-consul-oauth2-neo4j",
"extra-args": "--workspaces --monorepository",
"workspaces": "true"
}
Expand Down

0 comments on commit 0b10ddf

Please sign in to comment.