This commit is contained in:
Maxime Desroches
2024-07-12 15:06:58 -07:00
parent be794889a4
commit df54d62d71
6 changed files with 27 additions and 15 deletions

View File

@@ -16,11 +16,12 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Installing build dependencies
run: ./install_dependencies.sh
- name: Installing msgq
run: SCONS_EXTRAS=1 pip3 install --break-system-packages .[dev]
- name: python tests
- name: Building msgq
run: |
export BUILD_TESTS=1
scripts/install_dependencies.sh
pip3 install --break-system-packages .[dev]
- name: Python tests
run: ${{ matrix.backend }}=1 pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append
- name: C++ tests
run: |

4
.gitignore vendored
View File

@@ -18,4 +18,6 @@ services.h
libcereal_shared.*
.mypy_cache/
msgq.egg-info
build
build/
dist/
catch2/

View File

@@ -1,6 +1,4 @@
exclude msgq/**/*.o
recursive-exclude msgq/tests *
recursive-exclude msgq/visionipc/tests *
include SConscript
include SConstruct
recursive-include site_scons *

9
scripts/build_wheel.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR
./install_dependencies.sh
cd ..
python3 -m build

View File

@@ -2,7 +2,7 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR
cd $DIR/../
SUDO=""
@@ -49,8 +49,10 @@ $SUDO apt-get install -y --no-install-recommends \
xz-utils \
zlib1g-dev
git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git
cd Catch2
mv single_include/* ../
cd ..
rm -rf Catch2
if [[ -n "$BUILD_TESTS" ]]; then
git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git
cd Catch2
mv single_include/* ../
cd ..
rm -rf Catch2
fi

View File

@@ -11,7 +11,7 @@ class SconsBuild(Command):
pass
def run(self) -> None:
scons_flags = '--minimal' if 'SCONS_EXTRAS' not in os.environ else ''
scons_flags = '' if 'BUILD_TESTS' in os.environ else '--minimal'
subprocess.run([f"scons {scons_flags} -j$(nproc)"], shell=True).check_returncode()
class CustomBuild(build):