Add tests to ci

Test pyflix and simulation using pytest.
Fix running the sim in non-tty environment.
Test presence of some essential files in the docs.
This commit is contained in:
Oleg Kalachev
2026-08-28 19:29:40 +03:00
parent a77f213538
commit 68eb523beb
5 changed files with 61 additions and 6 deletions
+6 -5
View File
@@ -84,15 +84,16 @@ jobs:
run: sudo apt-get install -y libsdl2-dev
- name: Build simulator
run: make build_simulator
- name: Run simulator
- name: Install Python requirements
run: sudo apt install -y python3-pip && pip3 install -r tools/requirements.txt && pip3 install pytest
- name: Run simulator and tests
env:
GAZEBO_MODEL_PATH: ${{ github.workspace }}/gazebo/models
GAZEBO_PLUGIN_PATH: ${{ github.workspace }}/gazebo/build
GAZEBO_MODEL_DATABASE_URI: '' # disable downloading models
run: |
OUT=$(timeout -k 10s 120s gzserver --verbose gazebo/flix.world 2>&1 | tee /dev/stderr)
if echo "$OUT" | grep -Pq "\[Err\](?! \[RenderEngine)"; then
exit 1
fi
gzserver --verbose gazebo/flix.world &
pytest --capture=no --verbose tools/test.py
- uses: actions/upload-artifact@v7
with:
name: gazebo-plugin-binary
+5
View File
@@ -83,6 +83,11 @@ jobs:
ln -s "$FQBN/flix.ino.bin" "flix.$BOARD.bin"
ln -s "$FQBN/flix.ino.bootloader.bin" "flix.$BOARD.bootloader.bin"
done
- name: Test build artifacts
working-directory: docs/build
run: |
ls; ls index.html gyro.html geometry.html firmware.html flix.esp32.merged.bin flix.esp32c3.merged.bin \
flix.esp32s3.merged.bin flix.esp32s3.opi.merged.bin flix.esp32s3.qspi.merged.bin flix.flix2.merged.bin
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with: