-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (156 loc) · 5.93 KB
/
basic.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
---
name: basic
on: # yamllint disable-line rule:truthy rule:line-length
push:
pull_request:
jobs:
lava-lab-gen-syntax:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9.20', "3.10.15", "3.11.9", "3.12.6", 3.13]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: check syntax of lavalab-gen
run: |
python -m py_compile lavalab-gen.py 2> output
if [ -s output ] ; then cat output ; exit 1 ; fi
- name: check version change
run: |
python -m pip install --upgrade pip
pip install pyyaml
export OUTDIR=$(mktemp -d --dry-run)
./lavalab-gen.py -o $OUTDIR boards-ci2.yaml
grep -q 2024.xx $OUTDIR/local/masterci1/Dockerfile || exit 1
grep -q 2024.xx $OUTDIR/local/lab-ci-0/Dockerfile || exit 1
check-lava-lab-gen:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: install lavacli
run: sudo apt-get -y install lavacli
- run: ./lavalab-gen.py boards-ci.yaml
- run: cat output/local/docker-compose.yml
- name: Verify DNS query in docker
run: sh .github/docker-resolv.sh
- name: Build lava-docker
run: cd output/local && docker compose build
check-formats:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: install yamllint
run: sudo apt-get -y install yamllint
- name: verify yaml files
run: find -iname '*.yaml' | xargs yamllint
- name: verify yml files
run: find -iname '*.yml' | xargs yamllint
check-lava-upgrade:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: install lavacli
run: sudo apt-get -y install lavacli
- run: ./lavalab-gen.py boards-ci-2022.01.yaml
- run: cat output/local/docker-compose.yml
- name: Verify DNS query in docker
run: sh .github/docker-resolv.sh
- name: Build lava-docker
run: cd output/local && docker compose build
- name: Launch lava-docker
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Wait for first job to be completed
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs wait 1
- name: Run backup
run: ./backup.sh
- name: stop docker
run: cd output/local && docker compose down
- name: Clean old install
run: rm -r output
- name: Copy backup
run: cp -v backup-latest/* lava-master/backup/
- name: Run lavalab-gen
run: ./lavalab-gen.py boards-ci-2023.01.yaml
- name: Build lava-docker
run: cd output/local && docker compose build
- name: Launch lava-docker
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Wait for first job to be completed
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs wait 2
- name: Verify we still have logs
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs logs 1
- name: Verify we still have logs really
# yamllint disable-line rule:line-length
run: lavacli --uri http://admin:[email protected]:10080/RPC2 jobs logs 1 > log1 && [[ -s log1 ]] || exit 1
- name: stop docker
run: cd output/local && docker compose down
- name: restart lava-docker
run: cd output/local && docker compose up -d
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh
- name: Run backup of 2023.01
run: ./backup.sh
- name: stop docker
run: cd output/local && docker compose down
# - name: Clean old install
# run: rm -r output
# - name: Copy backup
# run: cp -v backup-latest/* lava-master/backup/
# - name: Run lavalab-gen
# run: ./lavalab-gen.py boards-ci-2023.06.yaml
# - name: Build lava-docker 2023.06
# run: cd output/local && docker compose build
# - name: Launch lava-docker 2023.06
# run: cd output/local && docker compose up -d
# - name: Wait for LAVA 2023.06 to be started
# run: sh .github/workflows/wait-for-docker.sh
#
# - name: Run backup of 2023.06
# run: ./backup.sh
# - name: stop docker
# run: cd output/local && docker compose down
- name: Clean old install
run: rm -r output
- name: Copy backup
run: cp -v backup-latest/* lava-master/backup/
- name: Run lavalab-gen
run: ./lavalab-gen.py boards-ci-2023.10.yaml
- name: Build lava-docker 2023.10
run: cd output/local && docker compose build
- name: Launch lava-docker 2023.10
run: cd output/local && docker compose up -d
- name: Wait for LAVA 2023.10 to be started
run: sh .github/workflows/wait-for-docker.sh
test-backup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install lavacli
run: sudo apt-get -y install lavacli
- name: test valid and invalid usage of backup.sh
run: |
./backup.sh -n && exit 1
./backup.sh -h || exit 1
./backup.sh --help || exit 1
- run: ./lavalab-gen.py boards-ci-testbackup.yaml
- name: Build lava-docker
run: cd output/local && docker compose build
- name: Wait for LAVA to be started
run: sh .github/workflows/wait-for-docker.sh central
- name: Run backup
run: ./backup.sh -n central
- name: Check backup
run: |
pwd
ls -l backup-latest