Skip building non-Python stuff in Python build #596
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: [push, pull_request] | |
concurrency: | |
group: test-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-cxx: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
cxx: g++-9 | |
extras: enabled | |
- os: ubuntu-22.04 | |
cxx: g++-12 | |
extras: enabled | |
- os: ubuntu-20.04 | |
cxx: clang++-10 | |
extras: enabled | |
- os: ubuntu-22.04 | |
cxx: clang++-14 | |
extras: enabled | |
- os: macos-12 | |
cxx: clang++ | |
extras: disabled | |
runs-on: ${{ matrix.os }} | |
env: | |
CXX: ${{ matrix.cxx }} | |
# Don't error on deprecations: Xcode marks sprintf deprecated and Boost references it | |
CXXFLAGS: -Wno-error=deprecated-declarations | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}-cxx-ccache-${{ hashFiles('**') }} | |
restore-keys: | | |
${{ runner.os }}-cxx-ccache- | |
- name: Install system packages | |
run: ./.ci/install-sys-pkgs.sh | |
- name: Set up ccache | |
run: ./.ci/ccache-path.sh | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install build requirements | |
run: ./.ci/py-build-requirements.sh | |
- name: Set up build directory | |
run: >- | |
meson setup build | |
-Dwerror=true | |
-Dauto_features=${{ matrix.extras }} | |
-Dcuda=disabled | |
-Dgdrapi=disabled | |
- name: Build | |
run: meson compile -C build | |
- name: Run tests | |
run: meson test -C build | |
- name: Show ccache stats | |
run: ccache -s | |
test-python: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
cc: gcc-9 | |
cxx: g++-9 | |
python-version: '3.8' | |
extras: enabled | |
# Disabled for now because numba/llvmlite (needed for tests) | |
# doesn't have a pypy wheel, and it's not worth the effect to | |
# install all the dependencies needed to make that work. | |
# - os: ubuntu-22.04 | |
# cxx: g++ | |
# python-version: pypy-3.7 | |
- os: ubuntu-22.04 | |
cc: gcc-12 | |
cxx: g++-12 | |
python-version: '3.12.0-rc.1' | |
extras: enabled | |
- os: ubuntu-20.04 | |
cc: clang-10 | |
cxx: clang++-10 | |
python-version: '3.12.0-rc.1' | |
extras: enabled | |
- os: ubuntu-22.04 | |
cc: clang-14 | |
cxx: clang++-14 | |
python-version: '3.12.0-rc.1' | |
extras: enabled | |
- os: macos-12 | |
cc: clang | |
cxx: clang++ | |
python-version: '3.12.0-rc.1' | |
extras: disabled | |
runs-on: ${{ matrix.os }} | |
env: | |
CXX: ${{ matrix.cxx }} | |
# Don't error on deprecations: Xcode marks sprintf deprecated and Boost references it | |
CXXFLAGS: -Wno-error=deprecated-declarations | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}-py-ccache-${{ hashFiles('**') }} | |
restore-keys: | | |
${{ runner.os }}-py-ccache- | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ matrix.python-version }}- | |
${{ runner.os }}-pip- | |
- name: Install system packages | |
run: ./.ci/install-sys-pkgs.sh | |
- name: Set up ccache | |
run: ./.ci/ccache-path.sh | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python dependencies | |
run: ./.ci/py-requirements.sh | |
env: | |
CC: ${{ matrix.cc }} # Do not pass -Werror when building dependencies | |
- run: >- | |
pip install -v | |
--config-settings=setup-args=-Dwerror=true | |
--config-settings=setup-args=-Dauto_features=${{ matrix.extras }} | |
. | |
- run: pip install -v . | |
- name: Run tests | |
run: ./.ci/py-tests.sh | |
# Skip pip-compile because not all configurations have a python3.8 binary | |
- run: SKIP=pip-compile pre-commit run --all-files | |
- name: Show ccache stats | |
run: ccache -s | |
coverage: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}-coverage-ccache-${{ hashFiles('**') }} | |
restore-keys: | | |
${{ runner.os }}-coverage-ccache- | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install system packages | |
run: ./.ci/install-sys-pkgs.sh | |
- name: Set up ccache | |
run: ./.ci/ccache-path.sh | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' # TODO: update to 3.12 after release | |
- name: Install Python dependencies | |
run: ./.ci/py-requirements.sh | |
- name: Install Python module | |
run: >- | |
pip install -v | |
--config-settings=setup-args=-Dwerror=true | |
--config-settings=setup-args=-Dauto_features=enabled | |
--config-settings=setup-args=-Dbuildtype=debug | |
--config-settings=setup-args=-Db_coverage=true | |
. | |
- name: Run Python tests | |
run: ./.ci/py-tests.sh | |
- name: Install build requirements | |
run: ./.ci/py-build-requirements.sh | |
- name: Set up C++ build | |
run: > | |
meson setup build | |
-Dwerror=true | |
-Dauto_features=enabled | |
-Dcuda=disabled | |
-Dgdrapi=disabled | |
-Dbuildtype=debug | |
-Db_coverage=true | |
- name: Build C++ | |
run: meson compile -C build | |
- name: Run C++ tests | |
run: meson test -C build | |
- name: Collect coverage | |
run: ./.ci/coverage.sh | |
- uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: lcov.info | |
- name: Show ccache stats | |
run: ccache -s | |
sdist: | |
needs: [test-cxx, test-python, coverage] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-3.11-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-3.11- | |
${{ runner.os }}-pip- | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' # TODO: update to 3.12 after release | |
- name: Install Python dependencies | |
run: ./.ci/py-requirements.sh | |
- run: pip install build==0.10.0 | |
- run: python -m build --sdist . | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sdist | |
path: ./dist/*.tar.gz | |
cibuildwheel: | |
needs: [test-cxx, test-python, coverage] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pypa/cibuildwheel@v2.15.0 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
- name: Tar debug symbols | |
run: cd wheelhouse && tar -Jcvf "spead2-$(sed 's/.*"\(.*\)"/\1/' ../src/spead2/_version.py)-debug.tar.xz" _spead2*.debug | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: debug_symbols | |
path: ./wheelhouse/spead2-*-debug.tar.xz |