-
-
Notifications
You must be signed in to change notification settings - Fork 93
135 lines (133 loc) · 5.2 KB
/
test-integration-jwt.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
name: Test Integration JWT
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:
- main
pull_request:
jobs:
applications:
name: ${{ matrix.app-type }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
timeout-minutes: 40
defaults:
run:
working-directory: ${{ github.workspace }}/app
strategy:
fail-fast: false
matrix:
node_version: [20]
os: [ubuntu-22.04]
app-type:
- jwt-with-angular-app
- jwt-with-blazor-app
- jwt-with-angular-cqrs-app
- jwt-with-blazor-cqrs-app
- jwt-with-mssql-app
- jwt-with-mysql-app
- jwt-with-mongo-app
- jwt-with-mongo-cqrs-app
- jwt-with-postgres-app
- jwt-with-react-app
- jwt-with-vue-app
include:
- app-type: jwt-with-angular-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-angular-cqrs-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-blazor-app
arg: 'import-jdl blazor'
extra-args: '--with-entities'
- app-type: jwt-with-blazor-cqrs-app
arg: 'import-jdl blazor'
extra-args: '--with-entities'
- app-type: jwt-with-mssql-app
arg: 'no'
- app-type: jwt-with-mysql-app
arg: 'no'
- app-type: jwt-with-mongo-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-mongo-cqrs-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-postgres-app
arg: 'no'
- app-type: jwt-with-react-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-vue-app
arg: 'import-jdl'
extra-args: '--with-entities'
env:
JHI_APP: ${{ matrix.app-type }}
JHI_ARG: ${{ matrix.arg }}
steps:
- uses: actions/checkout@v4
with:
path: jhipster-dotnetcore
fetch-depth: 2
- uses: jhipster/actions/setup-runner@v0
with:
java-version: 17
node-version: ${{ matrix.node_version }}
binary-dir: ${{ github.workspace }}/jhipster-dotnetcore/cli/
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: git history
run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit
working-directory: ${{ github.workspace }}/jhipster-dotnetcore
- name: PREPARE jhipster env
working-directory: ${{ github.workspace }}/jhipster-dotnetcore
run: npm ci && npm link
- name: 'GENERATE JHipster.NET app'
run: cli.cjs generate-sample ${{ matrix.app-type }} --skip-install --skip-checks --no-insight --with-entities
- uses: jhipster/actions/compare-sample@v0
id: compare
if: >-
github.event.pull_request &&
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare')
with:
generator-path: jhipster-dotnetcore
cmd: cli.cjs generate-sample ${{ matrix.app-type }} --skip-install --skip-checks --no-insight --with-entities
- name: 'INSTALL AND BUILD DEPENDENCIES of generated app'
run: dotnet build
env:
NODE_ENV: development
APP_VERSION: 1.0
- name: 'GENERATE JHipster.NET entities'
run: ../jhipster-dotnetcore/test-integration/scripts/04-generate-entities-sample.sh $JHI_APP $JHI_ARG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: 'RUN CLIENT UNIT TESTS of generated app'
run: npm test
- name: 'RUN SERVER UNIT TESTS of generated app'
run: ../jhipster-dotnetcore/test-integration/scripts/06-run-generated-server-tests-of-sample.sh $JHI_APP
- name: 'RUN E2E TESTS of generated app'
run: ../jhipster-dotnetcore/test-integration/scripts/07-tests-e2e.sh $JHI_APP $JHI_ARG
id: e2e
continue-on-error: true
- name: 'RUN SONAR ANALYZE on generated app'
run: ../jhipster-dotnetcore/test-integration/scripts/08-run-sonar-analyze.sh $JHI_APP
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: 'VERIFY FORMAT'
run: ../jhipster-dotnetcore/test-integration/scripts/09-verify-format.sh $JHI_APP
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v3
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.app-type }}
path: ${{ github.workspace }}/app/**/cypress/screenshots
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2