This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
120 lines (118 loc) · 3.29 KB
/
build.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
name: build
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: '11.x'
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop
- name: Set up MySQL
uses: mirromutth/[email protected]
with:
mysql database: 'PEOPLEMOVER_DB'
mysql user: 'user'
mysql password: 'PASSWORD'
env:
TZ: 'America/Detroit'
- name: Test
run: ./gradlew api:test
env:
TZ: 'America/Detroit'
- name: Build PR
run: ./gradlew api:assemble
env:
HEAD_BRANCH: ${{ github.head_ref }}
if: github.event_name == 'pull_request'
- name: Build
run: ./gradlew api:assemble
env:
HEAD_BRANCH: main
if: github.event_name == 'push'
- name: Release artifact
uses: actions/upload-artifact@v2
with:
name: peoplemover-api.jar
path: api/build/libs/PeopleMover-0.0.1-SNAPSHOT.jar
build-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Increment version
run: npm version patch
working-directory: ./ui
if: github.event_name == 'push'
- name: Copy version to meta.json
run: npm run generate-build-version
working-directory: ./ui
- name: NPM CI Install
run: npm ci
working-directory: ./ui
- name: Lint
run: npm run lint
working-directory: ./ui
- name: Unit Tests
run: npm run test:unit:ci
working-directory: ./ui
- name: Build
run: npm run build
working-directory: ./ui
- name: Zip Build
run: zip -r peoplemover-ui.zip build
working-directory: ./ui
- name: Release artifact
uses: actions/upload-artifact@v2
with:
name: peoplemover-ui.zip
path: ui/peoplemover-ui.zip
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: NPM Install
run: npm ci --legacy-peer-deps
working-directory: ./ui
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: '11.x'
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop
- name: Set up MySQL
uses: mirromutth/[email protected]
with:
mysql database: 'PEOPLEMOVER_DB'
mysql user: 'user'
mysql password: 'PASSWORD'
env:
TZ: 'America/Detroit'
- name: Test
run: npm run test:e2e:ci
working-directory: ./ui
env:
TZ: 'America/Detroit'
- name: Upload Screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: cypress
path: /home/runner/work/peoplemover/peoplemover/ui/cypress/videos