Skip to content

Commit aa6c09d

Browse files
better
1 parent 3c07c5a commit aa6c09d

File tree

4 files changed

+81
-22
lines changed

4 files changed

+81
-22
lines changed

.github/workflows/tests.yml

+58-20
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,75 @@ name: tests
33
on: [push, pull_request]
44

55
jobs:
6-
unit_tests:
7-
name: unit tests
6+
7+
static_analysis:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
12+
with:
13+
python-version: '3.11'
14+
- name: Installing requirements
15+
run:
16+
python -m pip install -r requirements.txt
17+
- name: Installing ubuntu requirements
18+
run: "sudo apt-get install -y cppcheck"
19+
- name: Static analysis
20+
run: pre-commit run --all
21+
22+
scons_test:
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: ["ubuntu-20.04", "ubuntu-24.04", "macos-14"]
27+
python: ["3.11", "3.12"]
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python }}
33+
- name: Installing python requirements
34+
run:
35+
python -m pip install -r requirements.txt
36+
- name: Installing ubuntu requirements
37+
if: ${{startsWith(matrix.os, 'ubuntu')}}
38+
run:
39+
scripts/ubuntu_dependencies.sh
40+
- name: Installing macos requirements
41+
if: ${{startsWith(matrix.os, 'macos')}}
42+
run:
43+
scripts/macos_dependencies.sh
44+
- name: Building
45+
run: scons -j$(nproc || sysctl -n hw.logicalcpu)
46+
47+
48+
full_tests:
849
runs-on: ubuntu-24.04
950
strategy:
1051
matrix:
52+
os: ["ubuntu-20.04", "ubuntu-24.04", "macos-14"]
53+
python: ["3.11", "3.12"]
1154
flags: ['', '--asan', '--ubsan']
1255
backend: ['MSGQ', 'ZMQ']
13-
python-version: ["3.11", "3.12"]
56+
exclude:
57+
- os: "macos-14"
58+
backend: "MSGQ"
1459
steps:
1560
- uses: actions/checkout@v4
1661
- uses: actions/setup-python@v5
1762
with:
18-
python-version: ${{ matrix.python-version }}
63+
python-version: ${{ matrix.python }}
64+
- name: Installing ubuntu requirements
65+
if: ${{startsWith(matrix.os, 'ubuntu')}}
66+
run:
67+
scripts/ubuntu_dependencies.sh
68+
- name: Installing macos requirements
69+
if: ${{startsWith(matrix.os, 'macos')}}
70+
run:
71+
scripts/macos_dependencies.sh
1972
- name: Building msgq
2073
run: |
21-
export BUILD_TESTS=1
22-
scripts/install_dependencies.sh
23-
pip3 install --break-system-packages .[dev]
74+
pip3 install -e .[dev]
2475
- name: Python tests
2576
run: ${{ matrix.backend }}=1 pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append
2677
- name: C++ tests
@@ -31,16 +82,3 @@ jobs:
3182
msgq/visionipc/test_runner
3283
- name: Upload coverage
3384
run: "bash <(curl -s https://codecov.io/bash) -v -F unit_tests_${{ matrix.backend }}"
34-
35-
static_analysis:
36-
name: static analysis
37-
runs-on: ubuntu-24.04
38-
steps:
39-
- uses: actions/checkout@v3
40-
- name: Building msgq
41-
run: |
42-
scripts/install_dependencies.sh
43-
pip3 install --break-system-packages .[dev]
44-
- name: Static analysis
45-
# TODO: a package pre-commit installs has a warning, remove the unset once that's fixed
46-
run: unset PYTHONWARNINGS && pre-commit run --all

.github/workflows/wheels.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
env:
2828
CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}"
2929
CIBW_ARCHS: "${{ matrix.platform.arch }}"
30-
CIBW_BEFORE_ALL_LINUX: "bash {project}/scripts/manylinux_dependencies.sh"
31-
CIBW_BEFORE_BUILD_MACOS: "bash {project}/scripts/macos_dependencies.sh"
30+
CIBW_BEFORE_ALL_LINUX: "bash NO_CATCH2=1 {project}/scripts/manylinux_dependencies.sh"
31+
CIBW_BEFORE_BUILD_MACOS: "bash NO_CATCH2=1 {project}/scripts/macos_dependencies.sh"
3232
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
3333
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
3434
#CIBW_TEST_COMMAND: "pip install -r {project}/requirements.txt && pytest {package}"

scripts/macos_dependencies.sh

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/bin/bash
2+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
3+
ROOT=$DIR/../
4+
25
brew bundle --file=- <<-EOS
36
brew "zeromq"
47
cask "gcc-arm-embedded"
58
brew "gcc@13"
69
EOS
10+
11+
if [[ -n "$NO_CATCH2" ]]; then
12+
cd /tmp
13+
git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git
14+
cd Catch2
15+
mv single_include/* "$ROOT"
16+
rm -rf Catch2
17+
fi

scripts/ubuntu_dependencies.sh

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
3+
ROOT=$DIR/../
24

35
if [[ ! $(id -u) -eq 0 ]]; then
46
if [[ -z $(which sudo) ]]; then
@@ -10,3 +12,11 @@ fi
1012

1113
$SUDO apt-get update
1214
$SUDO apt-get install -y --no-install-recommends clang opencl-headers libzmq3-dev ocl-icd-opencl-dev cppcheck
15+
16+
if [[ -n "$NO_CATCH2" ]]; then
17+
cd /tmp
18+
git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git
19+
cd Catch2
20+
mv single_include/* "$ROOT"
21+
rm -rf Catch2
22+
fi

0 commit comments

Comments
 (0)