forked from jhipster/generator-jhipster
-
Notifications
You must be signed in to change notification settings - Fork 0
255 lines (254 loc) · 10.1 KB
/
vue.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#
# Copyright 2013-2021 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: Vue
concurrency:
# Group PRs by head_ref, push to main branch by commit id, and others branch by ref.
group: ${{ github.workflow }}-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }}
cancel-in-progress: true
on:
push:
branches-ignore:
- 'dependabot/**'
- 'skip_ci*'
paths-ignore:
- 'package*.json'
- 'generators/*client/templates/angular/**'
- 'generators/*client/templates/react/**'
pull_request:
types: [closed, opened, synchronize, reopened]
branches:
- '*'
paths-ignore:
- 'package*.json'
- 'generators/*client/templates/angular/**'
- 'generators/*client/templates/react/**'
jobs:
applications:
name: ${{ matrix.app-sample }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ github.workspace }}/app
if: >-
!contains(github.event.head_commit.message, '[angular]') &&
!contains(github.event.head_commit.message, '[react]') &&
!contains(github.event.pull_request.title, '[angular]') &&
!contains(github.event.pull_request.title, '[react]') &&
!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.action != 'closed' &&
!contains(github.event.pull_request.labels.*.name, 'pr: skip-ci')
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
cache: [vue]
app-sample:
- vue-default
- vue-noi18n
- vue-fulli18n-es
- vue-gateway
- vue-gradle-session
- vue-ws-theme
- vue-oauth2
- vue-mongodb-kafka-cucumber
- vue-session-cassandra-fr
include:
- app-sample: vue-default
entity: sqlfull
environment: prod
war: 0
e2e: 1
- app-sample: vue-noi18n
entity: sqlfull
environment: prod
war: 0
e2e: 1
- app-sample: vue-fulli18n-es
entity: sql
environment: prod
war: 0
e2e: 1
- app-sample: vue-gateway
entity: sql
environment: dev
war: 0
e2e: 1
- app-sample: vue-gradle-session
entity: sql
environment: dev
war: 0
e2e: 1
- app-sample: vue-ws-theme
entity: sql
environment: dev
war: 0
e2e: 1
- app-sample: vue-oauth2
entity: sql
environment: prod
war: 0
e2e: 1
- app-sample: vue-mongodb-kafka-cucumber
entity: mongodb
environment: dev
war: 0
e2e: 1
- app-sample: vue-session-cassandra-fr
entity: cassandra
environment: dev
war: 0
e2e: 1
testcontainers: 1
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
#----------------------------------------------------------------------
- name: 'SETUP: Checkout generator-jhipster'
uses: actions/[email protected]
with:
path: generator-jhipster
fetch-depth: 2
- name: 'SETUP: environment'
id: setup
uses: ./generator-jhipster/.github/actions/setup
with:
entities-sample: ${{ matrix.entity }}
application-sample: ${{ matrix.app-sample }}
application-environment: ${{ matrix.environment }}
application-packaging: ${{ (matrix.war == 1 && 'war') || 'jar' }}
enable-testcontainers: ${{ matrix.testcontainers == 1 }}
- uses: actions/[email protected]
with:
node-version: ${{ steps.setup.outputs.node-version }}
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ steps.setup.outputs.java-version }}
- name: 'SETUP: load npm cache'
uses: actions/[email protected]
with:
path: |
~/.npm
~/.cache/Cypress/
key: ${{ runner.os }}-node-${{ steps.setup.outputs.date }}-${{ matrix.cache }}-${{ hashFiles('generator-jhipster/package-lock.json', 'generator-jhipster/**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.setup.outputs.date }}-${{ matrix.cache }}-
${{ runner.os }}-node-${{ steps.setup.outputs.date }}-
${{ runner.os }}-node-${{ steps.setup.outputs.date }}
- name: 'SETUP: load maven cache'
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ steps.setup.outputs.date }}-${{ hashFiles('generator-jhipster/**/pom.xml.ejs') }}
restore-keys: |
${{ runner.os }}-maven-${{ steps.setup.outputs.date }}-
${{ runner.os }}-maven-${{ steps.setup.outputs.date }}
- name: 'SETUP: load gradle cache'
if: contains(matrix.app-sample, 'gradle')
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ steps.setup.outputs.date }}-${{ hashFiles('generator-jhipster/**/build.gradle.ejs') }}
restore-keys: |
${{ runner.os }}-gradle-${{ steps.setup.outputs.date }}-
${{ runner.os }}-gradle-${{ steps.setup.outputs.date }}
- 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: config'
run: $JHI_SCRIPTS/11-generate-config.sh
- name: 'GENERATION: project'
run: $JHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies ${{ matrix.extra-args }} ${{ matrix.new-extra-args }}
- 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
#----------------------------------------------------------------------
# Detect changes against base commit
#----------------------------------------------------------------------
- name: 'MERGE: generate base'
continue-on-error: true
id: base-app
if: github.event.pull_request
uses: ./generator-jhipster/.github/actions/compare-base
with:
extra-args: '--skip-jhipster-dependencies ${{ matrix.extra-args }}'
- name: 'MERGE: compare changes'
continue-on-error: true
id: compare
if: steps.base-app.outcome == 'success'
uses: ./generator-jhipster/.github/actions/compare
with:
application-path: ${{ steps.base-app.outputs.application-path }}
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- name: 'TESTS: Start docker-compose containers for e2e and backend tests'
if: steps.compare.outputs.equals != 'true' && matrix.testcontainers == 0
run: npm run ci:e2e:prepare
- name: 'TESTS: backend'
id: backend
if: steps.compare.outputs.equals != 'true' && matrix.skip-backend-tests != 1
run: npm run ci:backend:test
- name: 'TESTS: frontend'
if: steps.compare.outputs.equals != 'true'
run: npm run ci:frontend:test
- name: 'TESTS: packaging'
if: steps.compare.outputs.equals != 'true'
run: npm run ci:e2e:package
- name: 'TESTS: Start docker-compose containers for e2e tests'
if: steps.compare.outputs.equals != 'true' && matrix.testcontainers != 0
run: npm run ci:e2e:prepare
- name: 'E2E: Run'
id: e2e
if: steps.compare.outputs.equals != 'true'
run: npm run ci:e2e:run --if-present
- name: 'E2E: Teardown'
if: always() && matrix.e2e == 1 && steps.compare.outputs.equals != 'true'
run: npm run ci:e2e:teardown
- name: 'BACKEND: Store failure logs'
uses: actions/upload-artifact@v2
if: always() && steps.backend.outcome == 'failure'
with:
name: log-${{ matrix.app-sample }}
path: ${{ steps.setup.outputs.application-path }}/*/test-results/**/*.xml
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v2
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.app-sample }}
path: ${{ steps.setup.outputs.application-path }}/*/cypress/screenshots
- name: 'ANALYSIS: Sonar analysis'
if: steps.compare.outputs.equals != 'true' && matrix.sonar-analyse != 0
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}