mirror of
https://github.com/commaai/msgq.git
synced 2026-06-10 23:14:26 +08:00
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
static_analysis:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Installing requirements
|
|
run:
|
|
python -m pip install -r requirements.txt
|
|
- name: Installing ubuntu requirements
|
|
run: "sudo apt-get install -y cppcheck"
|
|
- name: Static analysis
|
|
run: pre-commit run --all
|
|
|
|
scons_test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: ["ubuntu-20.04", "ubuntu-24.04", "macos-14"]
|
|
python: ["3.11", "3.12"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Installing python requirements
|
|
run:
|
|
python -m pip install -r requirements.txt
|
|
- name: Installing ubuntu requirements
|
|
if: ${{startsWith(matrix.os, 'ubuntu')}}
|
|
run:
|
|
scripts/ubuntu_dependencies.sh
|
|
- name: Installing macos requirements
|
|
if: ${{startsWith(matrix.os, 'macos')}}
|
|
run:
|
|
scripts/macos_dependencies.sh
|
|
- name: Building
|
|
run: scons -j$(nproc || sysctl -n hw.logicalcpu)
|
|
|
|
|
|
full_tests:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: ["ubuntu-20.04", "ubuntu-24.04"]
|
|
python: ["3.11", "3.12"]
|
|
flags: ['', '--asan', '--ubsan']
|
|
backend: ['MSGQ', 'ZMQ']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Installing ubuntu requirements
|
|
run:
|
|
scripts/ubuntu_dependencies.sh
|
|
- name: Building msgq
|
|
run: |
|
|
pip3 install -e .[dev]
|
|
- name: Python tests
|
|
run: ${{ matrix.backend }}=1 pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append
|
|
- name: C++ tests
|
|
run: |
|
|
export ${{ matrix.backend }}=1
|
|
scons ${{ matrix.flags }} -j$(nproc)
|
|
msgq/test_runner
|
|
msgq/visionipc/test_runner
|
|
- name: Upload coverage
|
|
run: "bash <(curl -s https://codecov.io/bash) -v -F unit_tests_${{ matrix.backend }}"
|