forked from jhipster/generator-jhipster
-
Notifications
You must be signed in to change notification settings - Fork 0
210 lines (209 loc) · 9.82 KB
/
incremental-changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#
# Copyright 2013-2020 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
#
# http://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: Incremental Changelog
on:
push:
branches-ignore:
- 'dependabot/**'
- 'skip_ci*'
pull_request:
branches:
- '*'
paths:
- 'utils/**'
- 'test-integration/incremental-changelog-samples/**'
- 'generators/entity/**'
- 'generators/database-chagelog/**'
- 'generators/database-chagelog-liquibase/**'
env:
JHI_RUN_APP: 1
JHI_JDK: 11
JHI_LIB_REPO: https://github.com/jhipster/jhipster.git
JHI_LIB_BRANCH: master
JHI_GEN_REPO: https://github.com/jhipster/generator-jhipster.git
JHI_GEN_BRANCH: master
SPRING_OUTPUT_ANSI_ENABLED: ALWAYS
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
JHI_E2E_HEADLESS: true
JHI_HOME: ${{ github.workspace }}/generator-jhipster
JHI_SCRIPTS: ${{ github.workspace }}/generator-jhipster/test-integration/scripts
JHI_FOLDER_APP: ${{ github.workspace }}/app
JHI_FOLDER_UAA: ${{ github.workspace }}/uaa
NG_CLI_ANALYTICS: 'false'
JHI_GITHUB_CI: true
FORCE_COLOR: 1
jobs:
applications:
name: ${{ matrix.app-type }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ github.workspace }}/app
if: >-
!contains(github.event.head_commit.message, '[ci skip]') &&
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.pull_request.title, '[skip ci]') &&
!contains(github.event.pull_request.title, '[ci skip]') &&
(github.event.pull_request.draft == false || !contains(github.event.pull_request.labels.*.name, 'pr: skip-ci')) &&
!contains(github.event.pull_request.user.login, 'dependabot')
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
node_version: [12.18.3]
os: [ubuntu-20.04]
app-type:
- liquibase-jdl-rename-field
include:
- app-type: liquibase-jdl-rename-field
entity: jdl
liquibase: jdl
profile: prod
war: 0
e2e: 1
env:
JHI_ENTITY: ${{ matrix.entity }}
JHI_APP: ${{ matrix.app-type }}
JHI_LIQUIBASE: ${{ matrix.liquibase }}
JHI_PROFILE: ${{ matrix.profile }}
JHI_WAR: ${{ matrix.war }}
JHI_E2E: ${{ matrix.e2e }}
JHI_TESTCONTAINERS: ${{ matrix.testcontainers }}
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
#----------------------------------------------------------------------
- name: 'SETUP: Checkout generator-jhipster'
uses: actions/checkout@v2
with:
path: generator-jhipster
- name: 'SETUP: Create required structure'
run: |
mkdir app
working-directory: ${{ github.workspace }}
- uses: actions/[email protected]
with:
node-version: ${{ matrix.node_version }}
- uses: actions/setup-java@v1
with:
java-version: '11.x'
- name: 'SETUP: Get chrome/chromedriver version'
id: chromedriver-version
run: |
CHROME_VERSION=$(google-chrome --version | cut -f 3 -d ' ' | cut -d '.' -f 1) \
&& CHROMEDRIVER_VERSION=$(curl --location --fail --retry 3 http://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}) \
&& echo "::set-output name=version::$CHROMEDRIVER_VERSION"
- name: 'SETUP: Get date'
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
- name: 'SETUP: load npm cache'
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster/package-lock.json', 'generator-jhipster/**/package.json.ejs') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-
- name: 'SETUP: load maven cache'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster/**/pom.xml.ejs') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.app-type }}-${{ steps.get-date.outputs.date }}-
- name: 'SETUP: load gradle cache'
if: contains(matrix.app-type, 'gradle')
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.app-type }}-${{ hashFiles('generator-jhipster/**/build.gradle.ejs') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.app-type }}-
- name: 'SETUP: load e2e cache'
if: matrix.e2e == 1
uses: actions/cache@v2
with:
path: |
~/.cache/selenium/
~/.cache/Cypress/
key: ${{ runner.os }}-e2e-${{ matrix.app-type }}-${{ steps.chromedriver-version.outputs.version }}-${{ hashFiles('generator-jhipster/**/package.json.ejs') }}
restore-keys: |
${{ runner.os }}-e2e-${{ matrix.app-type }}-${{ steps.chromedriver-version.outputs.version }}-
- name: 'ENV: display variables'
run: $JHI_SCRIPTS/01-display-configuration.sh
- 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
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
- name: 'GENERATION: install JHipster'
run: $JHI_SCRIPTS/10-install-jhipster.sh
- name: 'GENERATION: entities'
run: $JHI_SCRIPTS/11-generate-entities.sh
- name: 'GENERATION: project'
run: $JHI_SCRIPTS/12-generate-project.sh --with-entities --force --skip-jhipster-dependencies --creation-timestamp '2020-01-01'
env:
JHI_SAMPLES: ${{ github.workspace }}/generator-jhipster/test-integration/incremental-changelog-samples
- name: 'GENERATION: incremental project'
run: $JHI_SCRIPTS/12-generate-project.sh --incremental-changelog --with-entities --force
env:
JHI_SAMPLES: ${{ github.workspace }}/generator-jhipster/test-integration/incremental-changelog-samples
JHI_APP: ${{ matrix.app-type }}-post
- name: 'GENERATION: incremental changes'
run: |
git add .
git -c color.ui=always diff --cached
- name: 'GENERATION: replace version in generated project'
run: $JHI_SCRIPTS/13-replace-version-generated-project.sh
- name: 'GENERATION: jhipster info'
run: $JHI_SCRIPTS/14-jhipster-info.sh
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- name: 'TESTS: Start docker-compose containers'
run: $JHI_SCRIPTS/20-docker-compose.sh
- name: 'TESTS: backend'
run: $JHI_SCRIPTS/21-tests-backend.sh
- name: 'TESTS: frontend'
run: $JHI_SCRIPTS/22-tests-frontend.sh
- name: 'TESTS: packaging'
run: $JHI_SCRIPTS/23-package.sh
- name: 'E2E: Synchronize chromedriver version'
if: matrix.e2e == 1
run: npm run e2e:update-webdriver -- --versions.chrome ${{ steps.chromedriver-version.outputs.version }}
working-directory: ${{ github.workspace }}/app
- name: 'E2E: Run'
id: e2e
run: $JHI_SCRIPTS/24-tests-e2e.sh
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v2
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.app-type }}
path: ${{ github.workspace }}/app/target/cypress/screenshots
- name: 'ANALYSIS: Sonar analysis'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}