-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (91 loc) · 2.86 KB
/
ui.yaml
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
name: ui service
on:
push:
branches:
- '**'
paths:
- .github/workflows/prepare-release.yaml
- .github/workflows/parse-jest-results.yaml
- .github/workflows/build-docker.yaml
- .github/workflows/release.yaml
- .github/workflows/ui.yaml
- services/ui/**
jobs:
prepare-release:
uses: ./.github/workflows/prepare-release.yaml
with:
working-dir: ./services/ui
build:
name: 🔨 Build and test UI
runs-on: ubuntu-latest
outputs:
license-artifact-name: license-report
license-artifact-path: ./services/ui/license-report
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 🏗 Setup node env
uses: actions/setup-node@v3
with:
node-version-file: services/ui/.nvmrc
cache: 'npm'
cache-dependency-path: services/ui/package-lock.json
- name: 👨🏻💻 Install dependencies
working-directory: ./services/ui
run: npm clean-install
- name: 🧪 Run tests
working-directory: ./services/ui
run: npm run test:ci
- name: 📦 Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: ./services/ui/junit.xml
- name: 🔎 Upload coverage report
uses: codecov/codecov-action@v3
with:
files: ./services/ui/coverage/cobertura-coverage.xml
name: habitcentric/ui
- name: 🏗 Build
working-directory: ./services/ui
run: npm run build
- name: 📦 Upload build
uses: actions/upload-artifact@v3
with:
name: ui-build
path: ./services/ui/build
- name: 📋 Generate license report
working-directory: ./services/ui
run: |
npm run license-report >licenses.txt
zip -r license-report.zip licenses licenses.txt
- name: 📦 Upload license report
uses: actions/upload-artifact@v3
with:
name: license-report
path: ./services/ui/license-report.zip
docker:
name: 🔨 Build and push Docker image
uses: ./.github/workflows/build-docker.yaml
needs:
- prepare-release
- build
with:
image-name: ui
working-dir: ./services/ui
version: ${{ needs.prepare-release.outputs.release-version }}
artifact-name: ui-build
artifact-path: ./services/ui/build
github-release:
uses: ./.github/workflows/release.yaml
needs:
- prepare-release
- build
- docker
with:
service-name: ui
version: ${{ needs.prepare-release.outputs.release-version }}
change-notes: ${{ needs.prepare-release.outputs.release-notes }}
license-artifact-name: ${{ needs.build.outputs.license-artifact-name }}
license-artifact-path: ${{ needs.build.outputs.license-artifact-path }}