Skip to content

Commit e638477

Browse files
Merge pull request #305 from oss-slu/feature/loading-and-saving-mission-configurations
Implement Loading saved JSON files into the frontend configuration wizard #299
2 parents fa54678 + aacc6b7 commit e638477

67 files changed

Lines changed: 7237 additions & 1674 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend-ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- main
1111
- docker-main
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
backend-setup:
1518
runs-on: windows-latest
@@ -50,9 +53,41 @@ jobs:
5053
- name: Format backend code with Black
5154
run: |
5255
pip install black
53-
black backend/
56+
black --check backend/tests/test_settings_preview.py backend/PythonClient/server/simulation_server.py backend/PythonClient/multirotor/control/simulation_task_manager.py backend/mock_simulator/mock_task_manager.py
5457
5558
- name: Perform Dependency Audit
5659
run: |
5760
pip install safety
58-
safety check -r backend/requirements.txt
61+
safety check -r backend/requirements.txt
62+
63+
backend-test:
64+
runs-on: ubuntu-latest
65+
timeout-minutes: 15
66+
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Cache pip dependencies
72+
uses: actions/cache@v4
73+
with:
74+
path: ~/.cache/pip
75+
key: ${{ runner.os }}-pip-tests-${{ hashFiles('**/requirements.txt') }}
76+
restore-keys: |
77+
${{ runner.os }}-pip-tests-
78+
79+
- name: Set up Python
80+
uses: actions/setup-python@v5
81+
with:
82+
python-version: '3.10'
83+
84+
- name: Upgrade pip, setuptools, wheel
85+
run: |
86+
python -m ensurepip --upgrade
87+
python -m pip install --upgrade pip setuptools wheel
88+
89+
- name: Install backend dependencies
90+
run: pip install -r backend/requirements.txt
91+
92+
- name: Run backend unit tests
93+
run: python -m unittest discover -s backend/tests -p "test_*.py"

.github/workflows/frontend-ci.yml

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Frontend CI
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches:
@@ -90,4 +93,105 @@ jobs:
9093
uses: actions/upload-artifact@v4
9194
with:
9295
name: coverage-report
93-
path: coverage/
96+
path: frontend/coverage/
97+
98+
frontend-e2e:
99+
runs-on: ubuntu-latest
100+
timeout-minutes: 30
101+
needs:
102+
- frontend-test
103+
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v4
107+
108+
- name: Cache Node.js modules
109+
uses: actions/cache@v4
110+
with:
111+
path: ~/.npm
112+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
113+
restore-keys: |
114+
${{ runner.os }}-npm-
115+
116+
- name: Set up Node.js
117+
uses: actions/setup-node@v4
118+
with:
119+
node-version: "20"
120+
121+
- name: Install frontend dependencies
122+
run: |
123+
cd frontend
124+
npm install
125+
126+
- name: Start frontend and backend services
127+
timeout-minutes: 10
128+
env:
129+
SIMULATOR_TYPE: mock
130+
STORAGE_TYPE: local
131+
LOCAL_STORAGE_ROOT: /app
132+
run: |
133+
mkdir -p "$HOME/Documents/AirSim"
134+
printf '\nSIMULATOR_TYPE=mock\nSTORAGE_TYPE=local\nLOCAL_STORAGE_ROOT=/app\n' >> backend/.env
135+
export USERPROFILE="$HOME"
136+
docker compose -f docker-compose.dev.yaml up -d --build backend frontend
137+
138+
- name: Wait for backend
139+
timeout-minutes: 5
140+
run: |
141+
for i in {1..60}; do
142+
if curl -fsS http://localhost:5000/currentRunning >/dev/null; then
143+
exit 0
144+
fi
145+
sleep 5
146+
done
147+
docker compose -f docker-compose.dev.yaml logs --tail=200 backend frontend
148+
exit 1
149+
150+
- name: Wait for frontend
151+
timeout-minutes: 5
152+
run: |
153+
for i in {1..60}; do
154+
if curl -fsS http://localhost:3000 >/dev/null; then
155+
exit 0
156+
fi
157+
sleep 5
158+
done
159+
docker compose -f docker-compose.dev.yaml logs --tail=200 backend frontend
160+
exit 1
161+
162+
- name: Run Cypress end-to-end tests
163+
run: |
164+
cd frontend
165+
npm run cypress:run
166+
167+
- name: Upload Cypress screenshots
168+
if: failure()
169+
uses: actions/upload-artifact@v4
170+
with:
171+
name: cypress-screenshots
172+
path: frontend/cypress/screenshots/
173+
174+
- name: Upload Cypress videos
175+
if: failure()
176+
uses: actions/upload-artifact@v4
177+
with:
178+
name: cypress-videos
179+
path: frontend/cypress/videos/
180+
181+
- name: Upload backend reports
182+
if: always()
183+
uses: actions/upload-artifact@v4
184+
with:
185+
name: backend-reports
186+
path: backend/reports/
187+
188+
- name: Dump compose logs on failure
189+
if: failure()
190+
run: |
191+
docker compose -f docker-compose.dev.yaml logs --tail=300 backend frontend
192+
193+
- name: Stop frontend and backend services
194+
if: always()
195+
timeout-minutes: 5
196+
run: |
197+
docker compose -f docker-compose.dev.yaml down --volumes

0 commit comments

Comments
 (0)