-
Notifications
You must be signed in to change notification settings - Fork 14
165 lines (155 loc) · 5.8 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
---
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 }}
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: 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 }}
strategy:
matrix:
kind_version: [v0.22.0]
os: [macos-13]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Docker
run: |
brew install 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: 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-podman-rootless-linux:
name: Test Kind Deployment using Podman rootless on Linux
runs-on: ${{ matrix.os }}
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: Check that ingress is available
run: |
set +e
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:30080/)
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:30080
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:30080
curl -o /dev/null -s -w "%{http_code}\n" https://localhost:30443 --insecure
curl -o /dev/null -s -w "%{exitcode}\n" https://localhost:30443 --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 }}
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: 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
...