-
-
Notifications
You must be signed in to change notification settings - Fork 55
190 lines (190 loc) · 8.06 KB
/
smoke-test-imperative.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
name: Imperative Smoke Tests
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:
pull_request:
branches:
- main
push:
branches:
- main
# schedule:
# - cron: '0 2 * * *'
env:
JHI_SAMPLES: ${{ github.workspace }}/generator-jhipster-quarkus/.blueprint/generate-sample/templates/samples/
JHI_SCRIPTS: ${{ github.workspace }}/generator-jhipster/test-integration/scripts
jobs:
applications:
name: ${{ matrix.app }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
timeout-minutes: 60
defaults:
run:
working-directory: ${{ github.workspace }}/app
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
app:
- imperative-ngx-jwt-maven-mysql-caffeine
- imperative-ngx-jwt-maven-mongodb-caffeine
- imperative-ngx-jwt-gradle-mongodb-redis
- imperative-ngx-jwt-maven-psql-nocache
- imperative-react-jwt-gradle-mysql-caffeine
- imperative-ngx-jwt-maven-mysql-redis
- imperative-sql-jwt-maven-no-db
- imperative-ngx-oauth2-maven-mysql-caffeine
include:
- app: imperative-ngx-jwt-maven-mysql-caffeine
- app: imperative-ngx-jwt-maven-mongodb-caffeine
- app: imperative-ngx-jwt-maven-psql-nocache
- app: imperative-react-jwt-gradle-mysql-caffeine
- app: imperative-ngx-jwt-maven-mysql-redis
- app: imperative-ngx-oauth2-maven-mysql-caffeine
exclude:
- app: imperative-sql-jwt-maven-no-db
- app: imperative-ngx-jwt-gradle-mongodb-redis
steps:
- name: 'SETUP: Checkout quarkus blueprint'
uses: actions/checkout@v3
with:
path: generator-jhipster-quarkus
fetch-depth: 5
- name: 'SETUP: Checkout generator-jhipster'
uses: actions/checkout@v3
with:
repository: 'jhipster/generator-jhipster'
ref: v8.0.0-rc.1
path: generator-jhipster
- name: 'SETUP: environment'
id: setup
uses: ./generator-jhipster/.github/actions/setup
with:
jdl-sample: ${{ github.workspace }}/generator-jhipster-quarkus/.blueprint/generate-sample/templates/samples/${{ matrix.app }}.jdl
generator-jhipster-branch: local
jhipster-bom-branch: ignore
package-with-executable: generator-jhipster-quarkus
executable: jhipster-quarkus
- uses: actions/setup-node@v3
with:
# use node 16 for compare
node-version: 16
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: graalvm/setup-graalvm@v1
id: graalvm
if: ${{ !contains(fromJson('["push", "pull_request"]'), github.event_name) || contains(matrix.app, 'mysql-caffeine') }}
with:
java-version: '17'
distribution: 'graalvm'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'install blueprint'
run: npm install && npm link
working-directory: ${{ github.workspace }}/generator-jhipster-quarkus/
#----------------------------------------------------------------------
# Generate project
#----------------------------------------------------------------------
- name: 'GENERATION: project'
run: |
ls -la
jhipster-quarkus generate-sample ${{ matrix.app }}
#----------------------------------------------------------------------
# Detect changes against base commit
#----------------------------------------------------------------------
- name: 'MERGE: generate base'
continue-on-error: true
if: github.event.pull_request
id: base-app
run: |
npm uninstall -g generator-jhipster-quarkus
git checkout @~1
npm install
npm link
$JHI_SCRIPTS/11-generate-config.sh
$JHI_SCRIPTS/12-generate-project.sh --skip-install --skip-git
cp -a "${{ github.workspace }}/app/.git" "${{ github.workspace }}/base/app/"
working-directory: ${{ github.workspace }}/generator-jhipster-quarkus/
env:
JHI_JDL_APP: ${{ github.workspace }}/generator-jhipster-quarkus/test-integration/samples/${{ matrix.app }}.jdl
JHI_FOLDER_APP: ${{ github.workspace }}/base/app
- name: 'MERGE: compare changes'
continue-on-error: true
id: compare
if: steps.base-app.outcome == 'success'
working-directory: ${{ github.workspace }}/base/app
run: |
git log
# File keystore.p12 always changes
# File package-lock.json is not generated
# Verify if the generated source has changed
git add .
echo "Showing config diff changes (won't trigger builds)"
echo "::group::ignored"
git -c color.ui=always diff -R --cached -- \
'.yo-rc.json' '**/.yo-rc.json' \
'.gitignore' '**/.gitignore' \
'.gitattributes' '**/.gitattributes' \
'README.md' '**/README.md' \
'src/main/webapp/**' '**/src/main/webapp/**' \
'src/test/javascript/**' '**/test/javascript/**' \
'.jhipster/**' '**/.jhipster/**'
echo "::endgroup::"
echo "Showing source diff changes (will trigger builds)"
echo "::group::changes"
git -c color.ui=always diff -R --cached --exit-code -- . \
':!.yo-rc.json' ':!**/.yo-rc.json' \
':!.gitignore' ':!**/.gitignore' \
':!.gitattributes' ':!**/.gitattributes' \
':!README.md' ':!**/README.md' \
':!src/main/webapp/**' ':!**/src/main/webapp/**' \
':!src/test/javascript/**' ':!**/test/javascript/**' \
':!.jhipster/**' ':!**/.jhipster/**' \
':!package-lock.json' ':!**/package-lock.json' \
':!**/keystore.p12' \
&& echo "equals=true" >> $GITHUB_OUTPUT \
|| echo "has-changes=true" >> $GITHUB_OUTPUT
echo "::endgroup::"
#----------------------------------------------------------------------
# Run tests
#----------------------------------------------------------------------
- name: 'Run JHipster Application server tests'
run: npm run ci:backend:test
working-directory: ${{ steps.setup.outputs.application-path }}
- name: 'Run JHipster Application client tests'
run: npm run ci:frontend:test
working-directory: ${{ steps.setup.outputs.application-path }}
- name: 'Packaging'
run: npm run ci:e2e:package
working-directory: ${{ steps.setup.outputs.application-path }}
- name: 'E2E: Start docker-compose containers for e2e tests'
if: steps.compare.outputs.equals != 'true'
run: npm run ci:e2e:prepare
working-directory: ${{ steps.setup.outputs.application-path }}
- name: 'E2E: Run'
if: steps.compare.outputs.equals != 'true'
id: e2e
run: npm run ci:e2e:run --if-present
working-directory: ${{ steps.setup.outputs.application-path }}
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v2
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.app }}
path: ${{ steps.setup.outputs.application-path }}/*/cypress/screenshots
- name: 'Native: Build Image'
if: steps.graalvm.outcome == 'success'
id: native
run: npm run ci:native:prod
working-directory: ${{ steps.setup.outputs.application-path }}
- name: 'Native: Store failsafe reports'
uses: actions/upload-artifact@v2
if: always() && steps.native.outcome == 'failure'
with:
name: failsafe-reports-${{ matrix.app }}
path: /home/runner/app/target/failsafe-reports