-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (144 loc) · 5.43 KB
/
combined-workflow.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
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
146
147
148
149
150
151
152
153
154
155
156
157
name: Combined Workflow
on: [push]
jobs:
call-php-code-quality:
uses: ./.github/workflows/php-code-quality.yaml
call-php-unit-tests:
uses: ./.github/workflows/php-unit-tests.yaml
combine-php-test-coverage:
needs: [call-php-unit-tests]
runs-on: ubuntu-latest
steps:
- name: Download all coverage reports
uses: actions/download-artifact@v4
with:
pattern: 'coverage-*'
path: combined-coverage
merge-multiple: false # Keep separate directories
- name: Upload combined coverage
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: combined-coverage/
retention-days: 7
deploy-php-test-coverage:
needs: combine-php-test-coverage
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download combined coverage
uses: actions/download-artifact@v4
with:
name: coverage-reports
path: public/coverage
- name: Create index page
run: |
mkdir -p public
cat > public/index.html <<EOL
<!DOCTYPE html>
<html>
<head>
<title>eAppointment Documentation</title>
<style>
:root {
--primary: #0366d6;
--bg: #ffffff;
--text: #24292e;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.6;
color: var(--text);
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
background: var(--bg);
}
h1, h2 {
border-bottom: 1px solid #eaecef;
padding-bottom: 0.3em;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin: 2rem 0;
}
.card {
background: #f6f8fa;
border-radius: 6px;
padding: 1.5rem;
}
.card h2 {
margin-top: 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
margin: 0.5rem 0;
}
a {
color: var(--primary);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>eAppointment Documentation</h1>
<div class="grid">
<div class="card">
<h2>API Documentation</h2>
<ul>
<li><a href="zmscitizenapi/public/doc/">Citizen API Documentation</a></li>
<li><a href="zmsapi/public/doc/">ZMS API Documentation</a></li>
</ul>
</div>
<div class="card">
<h2>Code Coverage Reports</h2>
<ul>
<li><a href="coverage/coverage-zmsadmin/html/">zmsadmin Coverage</a></li>
<li><a href="coverage/coverage-zmscalldisplay/html/">zmscalldisplay Coverage</a></li>
<li><a href="coverage/coverage-zmscitizenapi/html/">zmscitizenapi Coverage</a></li>
<li><a href="coverage/coverage-zmsdldb/html/">zmsdldb Coverage</a></li>
<li><a href="coverage/coverage-zmsentities/html/">zmsentities Coverage</a></li>
<li><a href="coverage/coverage-zmsmessaging/html/">zmsmessaging Coverage</a></li>
<li><a href="coverage/coverage-zmsslim/html/">zmsslim Coverage</a></li>
<li><a href="coverage/coverage-zmsstatistic/html/">zmsstatistic Coverage</a></li>
<li><a href="coverage/coverage-zmsticketprinter/html/">zmsticketprinter Coverage</a></li>
<li><a href="coverage/coverage-zmsapi/html/">zmsapi Coverage</a></li>
<li><a href="coverage/coverage-zmsdb/html/">zmsdb Coverage</a></li>
<li><a href="coverage/coverage-zmsclient/html/">zmsclient Coverage</a></li>
</ul>
</div>
</div>
</body>
</html>
EOL
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
- name: Deploy to GitHub Pages
id: deployment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/deploy-pages@v4
call-php-build-images:
needs: [call-php-code-quality, call-php-unit-tests]
if: |
always() &&
needs.call-php-code-quality.result == 'success' &&
needs.call-php-unit-tests.result == 'success'
uses: ./.github/workflows/php-build-images.yaml