-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (85 loc) · 2.27 KB
/
test-setup.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
---
name: Test setup
on:
push:
branches:
- main
paths-ignore:
- COPYRIGHT.md
- .github/*.md
- .github/workflows/pre-commit.yml
- .gitignore
- img/**
- LICENSE
- .markdownlint.yaml
- .pre-commit-config.yaml
- pyproject.toml
- README.md
- renovate.json
- .secrets.baseline
pull_request:
branches:
- main
paths-ignore:
- COPYRIGHT.md
- .github/*.md
- .github/workflows/pre-commit.yml
- .gitignore
- img/**
- LICENSE
- .markdownlint.yaml
- .pre-commit-config.yaml
- pyproject.toml
- README.md
- renovate.json
- .secrets.baseline
jobs:
test-setup:
name: Run ./setup.sh
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install project dependencies
shell: bash
run: |
brew install cfssl curl helm ipcalc kubectl
brew install --cask multipass
hash -r
- name: Wait for multipass to be up
shell: bash
run: |
until multipass list; do
echo 'multipass is not running, will check again in 2 seconds'
sleep 2
done
- name: Confirm depdencies are available in PATH
shell: bash
run: |
multipass list
cfssl version
cfssljson --version
ipcalc --version
kubectl version --client
helm version
- name: Setup kubernetes
shell: bash
run: ./setup.sh
- name: Wait for kubernetes to be up
shell: bash
run: |
declare -a PODS=()
while IFS= read -r l; do
if [[ -n ${l} ]]; then
PODS+=("${l}")
fi
done < <(kubectl get pods -o json -A | jq -r '.items[] | .status.containerStatuses[]? | [.name] |join(":")')
for p in "${PODS[@]}"; do
until grep -q 'true' <(grep "${p}" <(kubectl get pods -o json -A | jq -r '.items[] | .status.containerStatuses[]? | [.name, .ready|tostring] |join(":")')); do
echo "Pod ${p} is not ready yet, will wait 2 seconds"
sleep 2
done
done
- name: Run tests
shell: bash
run: ./tests/tests.sh