Skip to content

Commit

Permalink
cache application
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Aug 21, 2024
1 parent 3eda7d4 commit 44ae1c0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/angular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,9 @@ jobs:
uses: jwalton/gh-docker-logs@v2
- name: 'ANALYSIS: Sonar analysis'
if: >-
github.event_name == 'push' &&
github.repository == 'jhipster/generator-jhipster' &&
matrix.sonar-analyse == 'true' &&
steps.compare.outputs.equals != 'true' &&
matrix.workspaces != 'true' &&
matrix.skip-frontend-tests != 'true' &&
needs.build-matrix.outputs.client != 'false' &&
matrix.skip-backend-tests != 'true' &&
needs.build-matrix.outputs.server != 'false'
github.event_name == 'push' &&
matrix.sonar-analyse == 'true'
run: |
./mvnw -ntp --batch-mode initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
Expand All @@ -191,6 +185,24 @@ jobs:
-Dsonar.login=$SONAR_TOKEN
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Cache save doesn't work with deep path exclude https://github.com/actions/toolkit/issues/713, remove manually
- name: Create application cache
if: >-
github.event_name == 'push' &&
matrix.sonar-analyse == 'true'
uses: actions/cache/save@v4
with:
path: |
app/*
!app/node_modules
!app/package-lock.json
!app/target
app/target/*
!app/target/node
!app/target/generated-sources
!app/target/*.original
!app/target/*.jar
key: application-${{ matrix.name }}-${{ github.sha }}
check-angular:
permissions:
contents: none
Expand Down
4 changes: 2 additions & 2 deletions test-integration/scripts/99-write-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ writeFileSync(
'jhipster-bom-cicd-version': BUILD_JHIPSTER_BOM ? JHIPSTER_BOM_CICD_VERSION : undefined,
'gradle-cache': generatorOptions?.workspaces || name.includes('gradle') ? true : undefined,
...sample,
'skip-backend-tests': sample['skip-backend-tests'] ? 'true' : 'false',
'skip-frontend-tests': sample['skip-frontend-tests'] ? 'true' : 'false',
'skip-backend-tests': sample['skip-backend-tests'] && sample['sonar-analyse'] !== 'true' ? 'true' : 'false',
'skip-frontend-tests': sample['skip-frontend-tests'] && sample['sonar-analyse'] !== 'true' ? 'true' : 'false',
};
});
} catch (error) {
Expand Down

0 comments on commit 44ae1c0

Please sign in to comment.