-
Notifications
You must be signed in to change notification settings - Fork 257
220 lines (219 loc) · 11.2 KB
/
github-action.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
on:
push:
branches-ignore:
- 'maint'
- 'stable'
jobs:
rt_test_sqlite:
runs-on: ubuntu-latest
steps:
- name: Set up for tests
shell: bash
run: |
echo "RT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RT_GA_START_TIME=$(date +%s)" >> $GITHUB_ENV
echo "DOCKER_BUILDKIT=0" >> $GITHUB_ENV
- name: Check out RT
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-sqlite
- name: Build RT
shell: bash
run: |
docker build -t rt-base .
docker run -d -v $GITHUB_WORKSPACE:/rt --name rt rt-base
docker exec rt bash -c "cd /rt && ./configure.ac --with-db-type=SQLite --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
- name: Run RT tests
shell: bash
run: docker exec rt bash -c "cd /rt && RT_TEST_PARALLEL_NUM=5 make test-parallel"
- name: Get run time
# Default is success(), we want to always() get the time
if: always()
shell: bash
run: |
export RT_GA_END_TIME=$(date +%s)
echo RT_GA_START_TIME ${{ env.RT_GA_START_TIME }}
echo RT_GA_END_TIME $RT_GA_END_TIME
echo "RT_GA_END_TIME=$RT_GA_END_TIME" >> $GITHUB_ENV
export RT_GA_TEST_TIME=$(( RT_GA_END_TIME - ${{ env.RT_GA_START_TIME }} ))
# Convert seconds to HH::MM::SS
export RT_GA_TEST_TIME=$(date -u -d @"$RT_GA_TEST_TIME" +"%T")
echo "RT_GA_TEST_TIME=$RT_GA_TEST_TIME" >> $GITHUB_ENV
- name: Post results to Slack
if: ${{ always() && github.repository_owner == 'bestpractical' }}
uses: edge/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS }}
with:
channel: '#github'
status: ${{ job.status }}
success_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests completed successfully in ${env.RT_GA_TEST_TIME}'
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RT Server, SQLite", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
rt_test_mariadb:
runs-on: ubuntu-latest
steps:
- name: Set up for tests
shell: bash
run: |
echo "RT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RT_GA_START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Checkout RT
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-mariadb
- name: Build RT
shell: bash
run: |
docker network create rt
docker run --network rt --name mariadb -e MYSQL_ROOT_PASSWORD=password -d mariadb:10.6
docker build --network rt -t rt-base .
docker run -d -v $GITHUB_WORKSPACE:/rt --env RT_TEST_DB_HOST=mariadb --env RT_TEST_RT_HOST=172.16.0.0/255.240.0.0 --network rt --name rt rt-base
docker exec rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
- name: Run RT tests
shell: bash
run: docker exec rt bash -c "cd /rt && RT_TEST_PARALLEL_NUM=5 make test-parallel"
- name: Get run time
if: always()
shell: bash
run: |
export RT_GA_END_TIME=$(date +%s)
echo RT_GA_START_TIME ${{ env.RT_GA_START_TIME }}
echo RT_GA_END_TIME $RT_GA_END_TIME
echo "RT_GA_END_TIME=$RT_GA_END_TIME" >> $GITHUB_ENV
export RT_GA_TEST_TIME=$(( RT_GA_END_TIME - ${{ env.RT_GA_START_TIME }} ))
# Convert seconds to HH::MM::SS
export RT_GA_TEST_TIME=$(date -u -d @"$RT_GA_TEST_TIME" +"%T")
echo "RT_GA_TEST_TIME=$RT_GA_TEST_TIME" >> $GITHUB_ENV
- name: Post results to Slack
if: ${{ always() && github.repository_owner == 'bestpractical' }}
uses: edge/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS }}
with:
channel: '#github'
status: ${{ job.status }}
success_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests completed successfully in ${env.RT_GA_TEST_TIME}'
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RT Server, MariaDB 10.6", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
rt_test_mysql8:
runs-on: ubuntu-latest
steps:
- name: Set up for tests
shell: bash
run: |
echo "RT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RT_GA_START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Checkout RT
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-mysql8
- name: Build RT
shell: bash
run: |
docker network create rt
docker run --network rt --name mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:8.0 --default-authentication-plugin=mysql_native_password
docker build --network rt -t rt-base .
docker run -d -v $GITHUB_WORKSPACE:/rt --name rt --env RT_TEST_DB_HOST=mysql --env RT_TEST_RT_HOST=172.16.0.0/255.240.0.0 --network rt --name rt rt-base
docker exec rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
- name: Run RT tests
shell: bash
run: docker exec rt bash -c "cd /rt && RT_TEST_PARALLEL_NUM=5 make test-parallel"
- name: Get run time
if: always()
shell: bash
run: |
export RT_GA_END_TIME=$(date +%s)
echo RT_GA_START_TIME ${{ env.RT_GA_START_TIME }}
echo RT_GA_END_TIME $RT_GA_END_TIME
echo "RT_GA_END_TIME=$RT_GA_END_TIME" >> $GITHUB_ENV
export RT_GA_TEST_TIME=$(( RT_GA_END_TIME - ${{ env.RT_GA_START_TIME }} ))
# Convert seconds to HH::MM::SS
export RT_GA_TEST_TIME=$(date -u -d @"$RT_GA_TEST_TIME" +"%T")
echo "RT_GA_TEST_TIME=$RT_GA_TEST_TIME" >> $GITHUB_ENV
- name: Post results to Slack
if: ${{ always() && github.repository_owner == 'bestpractical' }}
uses: edge/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS }}
with:
channel: '#github'
status: ${{ job.status }}
success_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests completed successfully in ${env.RT_GA_TEST_TIME}'
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "RT Server, MySQL 8.0", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]
rt_test_postgresql_apache_mod_fcgid:
runs-on: ubuntu-latest
steps:
- name: Set up for tests
shell: bash
run: |
echo "RT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RT_GA_START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Checkout RT
uses: actions/checkout@v2
- name: Cache .prove state
id: cache-prove-state
uses: actions/cache@v3
with:
path: .prove
key: ${{ runner.os }}-pg-fcgid
- name: Build RT
shell: bash
run: |
docker network create rt
docker run --network rt --name postgresql --mount type=tmpfs,destination=/var/lib/postgresql/data -e POSTGRES_PASSWORD=password -d postgres:12.8
docker build --network rt -t rt-base .
docker run -d -v $GITHUB_WORKSPACE:/rt --env RT_TEST_DB_HOST=postgresql --network rt --name rt rt-base
docker exec rt bash -c "chown -R rt-user /rt; touch /etc/apache2/mime.types"
docker exec -e USER=rt-user -u rt-user rt bash -c "cd /rt && ./configure.ac --with-db-type=Pg --with-my-user-group --enable-layout=inplace --with-web-handler=fcgid --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps && chmod a+rX /rt/sbin/*"
- name: Run RT tests
shell: bash
run: docker exec -e RT_DBA_USER=postgres -e RT_TEST_WEB_HANDLER=apache+fcgid -e HTTPD_ROOT=/etc/apache2 -e RT_TEST_APACHE=/usr/sbin/apache2 -e RT_TEST_APACHE_MODULES=/usr/lib/apache2/modules -u rt-user rt bash -c "cd /rt && RT_TEST_PARALLEL_NUM=5 make test-parallel"
- name: Get run time
if: always()
shell: bash
run: |
export RT_GA_END_TIME=$(date +%s)
echo RT_GA_START_TIME ${{ env.RT_GA_START_TIME }}
echo RT_GA_END_TIME $RT_GA_END_TIME
echo "RT_GA_END_TIME=$RT_GA_END_TIME" >> $GITHUB_ENV
export RT_GA_TEST_TIME=$(( RT_GA_END_TIME - ${{ env.RT_GA_START_TIME }} ))
# Convert seconds to HH::MM::SS
export RT_GA_TEST_TIME=$(date -u -d @"$RT_GA_TEST_TIME" +"%T")
echo "RT_GA_TEST_TIME=$RT_GA_TEST_TIME" >> $GITHUB_ENV
- name: Post results to Slack
if: ${{ always() && github.repository_owner == 'bestpractical' }}
uses: edge/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS }}
with:
channel: '#github'
status: ${{ job.status }}
success_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests completed successfully in ${env.RT_GA_TEST_TIME}'
failure_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests failed in ${env.RT_GA_TEST_TIME}'
cancelled_text: '${env.RT_BRANCH_NAME} (${env.GITHUB_RUN_NUMBER}) tests cancelled in ${env.RT_GA_TEST_TIME}'
fields: |
[{ "title": "Configuration", "value": "Apache mod_fcgid, PostgreSQL 12.8", "short": true },
{ "title": "URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}?check_suite_focus=true", "short": true }]