forked from jhipster/generator-jhipster-native
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (140 loc) · 5.42 KB
/
jdl.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
name: JDL 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:
push:
branches:
- '*'
paths-ignore:
- 'generators/ci-cd/**'
pull_request:
types: [closed, opened, synchronize, reopened]
branches:
- '*'
paths-ignore:
- 'generators/ci-cd/**'
permissions:
contents: read
jobs:
applications:
name: ${{ matrix.suite }} (${{ matrix.os }}, ${{ matrix.build-tool }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: ${{ github.workspace }}/app
if: github.event.action != 'closed'
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
build-tool: [maven, gradle]
suite:
- postgresql-mvc
- postgresql-webflux
- postgresql-mvc-jwt
- postgresql-webflux-jwt
include:
- os: windows-2022
profile: dev
e2e: 'false'
jdl-extra-args: '--skip-install'
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
#----------------------------------------------------------------------
- name: 'SETUP: create app folder'
run: mkdir app
working-directory: ${{ github.workspace }}
- name: 'SETUP: Configure keycloak host'
if: runner.os == 'Linux' || runner.os == 'macOS'
run: echo "127.0.0.1 keycloak" | sudo tee -a /etc/hosts
- name: 'SETUP: setup node'
uses: actions/setup-node@v4
with:
node-version: 18
- name: 'SETUP: checkout generator-jhipster-native'
uses: actions/checkout@v4
with:
path: generator-jhipster-native
fetch-depth: 2
- name: 'SETUP: install generator-jhister-native'
run: |
npm ci --prod
npm link
working-directory: ${{ github.workspace }}/generator-jhipster-native
- name: 'SETUP: setup graalvm'
uses: graalvm/setup-graalvm@v1
with:
version: '22.3.3'
java-version: '17'
distribution: 'graalvm-community'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: 'SETUP: get date'
id: get-date
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
- name: 'SETUP Windows: force npm to use bash'
if: runner.os == 'Windows'
run: |
echo "script-shell=bash" >.npmrc
cat .npmrc
- name: 'SETUP MacOS: load Homebrew cache'
uses: actions/cache@v3
if: runner.os == 'macOS'
with:
path: |
~/Library/Caches/Homebrew/downloads/*--Docker.dmg
key: brew-actions-setup-docker-1.0.11
restore-keys: brew-actions-setup-docker-
- name:
'SETUP MacOS: install docker'
# v1.0.11 (5d9a5f65f510c01ec5f0bd81d5c95768b1ec032a)
uses: docker-practice/actions-setup-docker@5d9a5f65f510c01ec5f0bd81d5c95768b1ec032a
# alternative solution https://github.com/actions/runner/issues/1456
if: runner.os == 'macOS'
timeout-minutes: 30
with:
docker_buildx: false
- run: ls ~/Library/Caches/Homebrew/
if: runner.os == 'macOS'
- name: 'SETUP: load npm cache'
uses: actions/cache@v3
with:
path: |
~/.npm
~/.cache/Cypress/
key: ${{ runner.os }}-npm-${{ matrix.suite }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster-native/package*.json') }}
- name: 'SETUP: load maven cache'
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.suite }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster-native/package*.json') }}
#----------------------------------------------------------------------
# Install JHipster and generate project+entities
#----------------------------------------------------------------------
- name: 'PROJECT: generate'
run: 'JHI_PROFILE=${{ matrix.profile }} jhipster-native generate-sample ${{ matrix.suite }}.jdl --build ${{ matrix.build-tool }} --no-insight --skip-git --skip-commit-hook --skip-jhipster-dependencies --no-cypress-audit ${{ matrix.jdl-extra-args }}'
- name: 'Windows: install npm dependencies'
# Workaround max PATH size https://github.com/jhipster/generator-jhipster-native/pull/65#issuecomment-1249555392
if: runner.os == 'Windows'
run: npm install
- name: 'TESTS: backend tests'
run: npm run ci:backend:test
# Native build is memory intensive, containers should not be started.
- name: 'TESTS: build application package'
timeout-minutes: 60
run: npm run native-package -- ${{ matrix.native-package-extra-args }}
- name: 'TESTS: start docker dependencies'
run: npm run ci:e2e:prepare
if: matrix.e2e != 'false'
- name: 'TESTS: run e2e'
run: npm run native-e2e --if-present
if: matrix.e2e != 'false'
- name: Dump docker logs
if: always() && matrix.e2e != 'false'
uses: jwalton/gh-docker-logs@v2