-
-
Notifications
You must be signed in to change notification settings - Fork 4k
138 lines (137 loc) · 5.17 KB
/
devserver.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
#
# Copyright 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: Dev Server
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'
- '**maintenance'
paths:
- '.github/workflows/devserver.yml'
- 'generators/angular/**'
- 'generators/client/**'
- 'generators/react/**'
- 'generators/vue/**'
pull_request:
types: [closed, opened, synchronize, reopened]
branches:
- '*'
jobs:
build-matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.build.outputs.matrix }}
empty-matrix: ${{ steps.build.outputs.empty-matrix }}
steps:
- name: 'SETUP: Checkout generator-jhipster'
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: 'Build matrix'
id: build
uses: ./.github/actions/build-matrix
with:
workflow-file-prefix: devserver
applications:
name: ${{ matrix.app-sample }}
needs: build-matrix
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ${{ github.workspace }}/app
timeout-minutes: 40
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}}
if: needs.build-matrix.outputs.empty-matrix != 'true'
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
#----------------------------------------------------------------------
- name: 'SETUP: Checkout generator-jhipster'
uses: actions/checkout@v4
with:
path: generator-jhipster
fetch-depth: 2
- name: 'SETUP: environment'
id: setup
uses: ./generator-jhipster/.github/actions/setup
with:
application-sample: ${{ matrix.setup-application-sample }}
entities-sample: ${{ matrix.setup-entities-sample }}
jdl-entities-sample: ${{ matrix.setup-jdl-entities-sample }}
jdl-sample: ${{ matrix.setup-jdl-sample }}
application-environment: ${{ matrix.setup-application-environment }}
application-packaging: ${{ matrix.setup-application-packaging }}
- uses: actions/setup-node@v4
with:
node-version: ${{ steps.setup.outputs.node-version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ steps.setup.outputs.java-version }}
- uses: jhipster/actions/restore-cache@v0
with:
npm: true
maven: true
gradle: ${{ matrix.workspaces == 'true' || matrix.gradle == 1 || contains(matrix.name, 'gradle') }}
- 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 ${{ matrix.extra-args }} ${{ matrix.new-extra-args }}
- name: 'GENERATION: jhipster info'
run: $JHI_SCRIPTS/14-jhipster-info.sh
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- name: 'E2E: Run'
id: e2e
run: ./npmw run e2e:devserver --if-present
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v4
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.app-sample }}
path: ${{ steps.setup.outputs.application-path }}/*/cypress/screenshots
check-dev-server:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [applications]
if: always()
steps:
- run: |
echo '${{ toJSON(needs) }}'
if [ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then
exit 0
fi
exit 1