-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (136 loc) · 5.76 KB
/
ci.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
name: build images, deploy and run testsuite
on:
push
jobs:
build-and-push-testsuite:
name: Build & Push testsuite docker image
strategy:
matrix:
rhel: [7, 9]
repo: [stable, beta]
exclude:
- rhel: 9
repo: stable
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build & Push image
uses: docker/build-push-action@v5
with:
context: docker/testsuite
file: ./docker/testsuite/Dockerfile.centos${{ matrix.rhel }}
push: true
tags: italiangrid/voms-testsuite:centos${{ matrix.rhel }}-${{ matrix.repo }}
build-args: |
VOMS_REPO=${{ matrix.repo }}
RHEL_VERSION=${{ matrix.rhel }}
build-and-push-voms:
name: Build & Push VOMS core docker image
strategy:
matrix:
rhel: [7, 9]
repo: [stable, beta]
exclude:
- rhel: 9
repo: stable
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build & Push image
uses: docker/build-push-action@v5
with:
context: docker/voms
file: ./docker/voms/Dockerfile.centos${{ matrix.rhel }}
push: true
tags: italiangrid/voms:centos${{ matrix.rhel }}-${{ matrix.repo }}
build-args: |
VOMS_REPO=${{ matrix.repo }}
RHEL_VERSION=${{ matrix.rhel }}
run-testsuite:
name: Run VOMS robot testsuite
strategy:
matrix:
client: [7-beta, 7-stable, 9-beta]
server: [7-beta, 7-stable, 9-beta]
runs-on: ubuntu-latest
continue-on-error: true
needs: [build-and-push-testsuite, build-and-push-voms]
env:
ROBOT_OPTIONS: --variable vo1:vo.0 --variable vo1_host:voms.test.example --variable vo1_issuer:/C=IT/O=IGI/CN=*.test.example --variable vo2:vo.1 --variable vo2_host:voms.test.example --variable vo2_issuer:/C=IT/O=IGI/CN=*.test.example
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Provide trustanchors
run: docker compose --file docker-compose.ci.yml up trust
working-directory: compose
- name: Start compose
run: docker compose --file docker-compose.ci.yml up --detach db voms testsuite
working-directory: compose
env:
TS_IMAGE: italiangrid/voms-testsuite:centos${{ matrix.client }}
VOMS_IMAGE: italiangrid/voms:centos${{ matrix.server }}
- name: Deploy db and voms
run: |
docker compose --file docker-compose.ci.yml exec -T --workdir /scripts db bash /scripts/populate-db.sh
docker compose --file docker-compose.ci.yml exec -T --workdir /scripts voms bash /scripts/setup-and-start-voms.sh
working-directory: compose
- name: Create artifacts dir
if: ${{ always() }}
run: |
ARTIFACTS_PATH=${HOME}/artifacts
echo ARTIFACTS_PATH: ${ARTIFACTS_PATH}
# save it in the job environment
echo "ARTIFACTS_PATH=${ARTIFACTS_PATH}" >> ${GITHUB_ENV}
mkdir -p ${ARTIFACTS_PATH}/logs ${ARTIFACTS_PATH}/java ${ARTIFACTS_PATH}/cpp
- name: Enable legacy OpenSSL crypto policies on EL9
if: matrix.client == '9-beta'
run: docker compose --file docker-compose.ci.yml exec -T testsuite bash -c "sudo update-crypto-policies --set LEGACY"
working-directory: compose
- name: Run testsuite for java clients
run: docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh
working-directory: compose
continue-on-error: true
- name: Collect test report for java clients
if: ${{ always() }}
run: |
docker compose --file docker-compose.ci.yml cp testsuite:/tmp/reports ${ARTIFACTS_PATH}/java
docker compose --file docker-compose.ci.yml exec -T testsuite rm -rf /tmp/reports
working-directory: compose
- name: Run testsuite for cpp clients
run: |
docker compose --file docker-compose.ci.yml exec -T -u root testsuite bash -c "update-alternatives --set voms-proxy-init /usr/bin/voms-proxy-init2; update-alternatives --set voms-proxy-info /usr/bin/voms-proxy-info2; update-alternatives --set voms-proxy-destroy /usr/bin/voms-proxy-destroy2"
docker compose --file docker-compose.ci.yml exec -T -e ROBOT_OPTIONS="${ROBOT_OPTIONS}" testsuite bash /scripts/ci-run-testsuite.sh --variable client_version:2 --include legacy
working-directory: compose
continue-on-error: true
- name: Collect test report for cpp clients
if: ${{ always() }}
run: docker compose --file docker-compose.ci.yml cp testsuite:/tmp/reports ${ARTIFACTS_PATH}/cpp
working-directory: compose
- name: Collect logs
if: ${{ always() }}
run: |
docker compose --file docker-compose.ci.yml logs --no-color testsuite > ${ARTIFACTS_PATH}/logs/testsuite.log
docker compose --file docker-compose.ci.yml logs --no-color voms > ${ARTIFACTS_PATH}/logs/voms.log
working-directory: compose
- name: Stop compose
if: ${{ always() }}
run: docker compose --file docker-compose.ci.yml down --volumes
working-directory: compose
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-report-and-logs_${{ matrix.client}}_${{ matrix.server }}
path: ${{ env.ARTIFACTS_PATH }}