-
Notifications
You must be signed in to change notification settings - Fork 14
198 lines (188 loc) · 6.98 KB
/
pr.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
---
name: Pull Request Test
on:
push:
workflow_dispatch:
pull_request:
jobs:
install-requirements:
name: Test installation of the project requirements
runs-on: ubuntu-latest
strategy:
matrix:
python: [ 3.11 ]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install python requirements
run: |
pip install -r requirements.txt
pip install -r molecule/requirements.txt
ansible-galaxy collection install -r collections/requirements.yml --upgrade
- name: Print configuration versions
run: |
pip freeze
ansible-galaxy collection list
# - name: Run role tests
# run: |
# molecule test --scenario-name github
kind-test-docker-linux:
name: Test Kind Deployment using Docker on Linux
runs-on: ${{ matrix.os }}
env:
IngressHTTPPort: 80
strategy:
matrix:
kind_version: [v0.22.0]
os: [ubuntu-latest]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Deploy kind
run: |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64
chmod 755 kind
./kind/registry.sh install --registry-name kind-registry.local
./kind/kind.sh install --registry-name kind-registry.local
- name: Wait for ingress to be available
uses: iFaxity/wait-on-action@v1
with:
resource: http://localhost:80
timeout: 120000
- name: Check that ingress is available
run: |
set +e
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost)
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}."
curl -o /dev/null -s -w "%{http_code}\n" http://localhost
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost
exit 1
fi
kind-test-docker-macos:
name: Test Kind Deployment using Docker on MacOS
runs-on: ${{ matrix.os }}
env:
IngressHTTPPort: 80
strategy:
matrix:
kind_version: [v0.22.0]
os: [macos-13]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Docker
run: |
brew install --cask docker
- name: Deploy kind
run: |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64
chmod 755 kind
./kind/registry.sh install --registry-name kind-registry.local
./kind/kind.sh install --registry-name kind-registry.local
- name: Wait for ingress to be available
uses: iFaxity/wait-on-action@v1
with:
resource: http://localhost:$IngressHTTPPort
timeout: 60000
- name: Check that ingress is available
run: |
set +e
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort)
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}."
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort
exit 1
fi
kind-test-podman-rootless-linux:
name: Test Kind Deployment using Podman rootless on Linux
runs-on: ${{ matrix.os }}
env:
IngressHTTPPort: 30080
IngressHTTPSPort: 30443
strategy:
matrix:
kind_version: [v0.22.0]
os: [ubuntu-latest]
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Checkout project
uses: actions/checkout@v3
- name: Deploy kind
run: |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64
chmod 755 kind
./kind/registry.sh install --registry-name kind-registry.local --provider podman --rootless
./kind/kind.sh install --registry-name kind-registry.local --provider podman --rootless
# - name: Wait before checking if ingress available
# uses: GuillaumeFalourd/wait-sleep-action@v1
# with:
# time: '60' # for 60 seconds
- name: Wait for ingress to be available
uses: iFaxity/wait-on-action@v1
with:
resource: http://localhost:$IngressPort
timeout: 60000
- name: Check that ingress is available
run: |
set +e
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort/)
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}."
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort
curl -o /dev/null -s -w "%{http_code}\n" https://localhost:$IngressHTTPSPort --insecure
curl -o /dev/null -s -w "%{exitcode}\n" https://localhost:$IngressHTTPSPort --insecure
echo "Not going to fail as rootless containers still don't work with podman."
exit 0
else
echo "If rootless containers now work must review this workflow."
exit 1
fi
kind-test-podman-rootful-linux:
name: Test Kind Deployment using Podman rootful on Linux
runs-on: ${{ matrix.os }}
env:
IngressHTTPPort: 80
strategy:
matrix:
kind_version: [v0.22.0]
os: [ubuntu-latest]
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Checkout project
uses: actions/checkout@v3
- name: Deploy kind
run: |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64
chmod 755 kind
./kind/registry.sh install --registry-name kind-registry.local --provider podman
./kind/kind.sh install --registry-name kind-registry.local --provider podman
- name: Wait for ingress to be available
uses: iFaxity/wait-on-action@v1
with:
resource: http://localhost:$IngressHTTPPort
timeout: 60000
- name: Check that ingress is available
run: |
set +e
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort)
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}."
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort
exit 1
fi
...