-
Notifications
You must be signed in to change notification settings - Fork 18
85 lines (79 loc) · 2.6 KB
/
main.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: Basic Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
defaults:
run:
shell: bash -el {0}
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
run-demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start demo
run: |
./run_demo.sh --exit-when-done
- name: Debugging information
run: |
export KUBECONFIG=$PWD/.demo/kube.conf
.demo/kubectl get pods
for pod_name in $(.demo/kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|rabbitmq|opensearch)'); do
echo "${pod_name}"
.demo/kubectl describe pod/"${pod_name}" || true
for container_name in $(.demo/kubectl get pods $pod_name -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}'); do
echo $pod_name $container_name
.demo/kubectl logs "${pod_name}" -c "${container_name}" || true
done
done
- name: Check for success
run: |
if [ ! -f ".demo/.success" ]; then
echo "Demo failed"
cat ".demo/.failed"
exit 1
fi
# Same as run-demo except mount the sources inside the container
run-demo-mount-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone source
run: |
git clone https://github.com/DIRACGrid/diracx.git /tmp/diracx
git clone https://github.com/DIRACGrid/DIRAC.git /tmp/DIRAC
- name: Start demo
run: |
./run_demo.sh --exit-when-done /tmp/diracx /tmp/DIRAC
- name: Debugging information
run: |
export KUBECONFIG=$PWD/.demo/kube.conf
.demo/kubectl get pods
for pod_name in $(.demo/kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|rabbitmq|opensearch)'); do
echo "${pod_name}"
.demo/kubectl describe pod/"${pod_name}" || true
for container_name in $(.demo/kubectl get pods $pod_name -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}'); do
echo $pod_name $container_name
.demo/kubectl logs "${pod_name}" -c "${container_name}" || true
done
done
- name: Check for success
run: |
if [ ! -f ".demo/.success" ]; then
echo "Demo failed"
cat ".demo/.failed"
exit 1
fi