Repository navigation
132 lines (113 loc) · 3.6 KB
/
Copy pathtest.yaml
File metadata and controls
132 lines (113 loc) · 3.6 KB
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
name: Test K8TRE Deployment to K3S
on:
pull_request:
branches:
- main
push:
branches:
- main
- "dev-*"
workflow_dispatch:
jobs:
# pre-commit:
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-python@v6
# - uses: pre-commit/action@v3.0.1
test:
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
K8TRE_DOMAIN: dev.k8tre.internal
steps:
- name: Free up disk space on GitHub runner
uses: manics/action-free-disk-space@1.0.0
with:
desired-space: 40000
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: dev-requirements.txt
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
playwright install
- name: Modify hosts to resolve k8tre.internal URLs
run: |
K8TRE_SUBDOMAINS="jupyter.$K8TRE_DOMAIN guacamole.$K8TRE_DOMAIN keycloak.$K8TRE_DOMAIN"
h=$(grep "$(hostname -i) " /etc/hosts)
if [ -n "$h" ]; then
sudo sed -i -re "s/$h/$h $K8TRE_SUBDOMAINS/" /etc/hosts
else
echo $(hostname -i) $K8TRE_SUBDOMAINS | sudo tee -a /etc/hosts
fi
cat /etc/hosts
- name: Install deployment
run: |
./ci/run_codeblocks.py docs/development/k3s-dev.md --run
- name: Run tests (not UI)
run: |
python -m pytest -v -s --color=yes -m "not ui"
- name: Run tests (UI)
run: |
python -m pytest -v -s --color=yes -m ui
- name: Upload screenshot
uses: actions/upload-artifact@v6
if: always()
with:
name: screenshots
path: screenshots/*
if-no-files-found: error
- name: Get ArgoCD logs, including on failure
if: always()
run: |
echo "::group::argocd-server"
kubectl -nargocd logs deploy/argocd-server
echo "::endgroup::"
- name: Get ArgoCD apps, including on failure
if: always()
run: |
for kind in appprojects applicationsets applications; do
echo "::group::argocd $kind"
kubectl describe $kind -A
echo "::endgroup::"
done
- name: Get main K8s resources, including on failure
if: always()
run: |
# Ignore errors since this is for debugging
set +e
for namespace in $(kubectl get namespace -ojsonpath='{.items[*].metadata.name}'); do
echo "***** $namespace *****"
for kind in daemonset deployment statefulset ingress service pod; do
for name in $(kubectl -n$namespace get $kind -ojsonpath='{.items[*].metadata.name}'); do
echo "::group::$kind/$name"
kubectl -n$namespace describe $kind/$name
echo "::endgroup::"
done
done
done
# Set a single status check for the whole workflow, so that we can use it in a
# branch protection rule
status-check:
runs-on: ubuntu-24.04
needs:
# - pre-commit
- test
if: always()
steps:
- name: Get job statuses
uses: technote-space/workflow-conclusion-action@v3.0.3
with:
FALLBACK_CONCLUSION: failure
STRICT_SUCCESS: true
# Status is saved in env.WORKFLOW_CONCLUSION
- name: Status check
if: env.WORKFLOW_CONCLUSION != 'success'
run: |
exit 1