test building the example project #59
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: Run tests | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
jobs: | |
pytest: | |
uses: colcon/ci/.github/workflows/pytest.yaml@main | |
meson: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [0.61, 1.3, 'latest'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
cache: 'pip' | |
- run: pip install -e .[test] | |
- run: pip install meson==${{ matrix.version }} | |
if: ${{ matrix.version != 'latest' }} | |
- run: pip install --upgrade meson | |
if: ${{ matrix.version == 'latest' }} | |
- run: pytest | |
build: | |
name: "Meson API (${{ matrix.linux_version }}, Python: ${{ matrix.python_version }}, Meson: ${{ matrix.meson_version }})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
meson_version: ["native", "0.61", "1.3", 'latest'] | |
linux_version: ["almalinux:8", "almalinux:9", "ubuntu:20.04", "ubuntu:22.04"] | |
exclude: | |
- { linux_version: "almalinux:8", meson_version: "1.3" } | |
container: | |
image: ${{ matrix.linux_version }} | |
steps: | |
- name: install dependencies | |
shell: bash | |
run: | | |
if command -v apt &> /dev/null; then | |
apt update && apt -y install lsb-release python3 python3-pip ninja-build | |
fi | |
if command -v dnf &> /dev/null; then | |
dnf -y install 'dnf-command(config-manager)' | |
dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled crb | |
dnf -y install redhat-release python3 python3-pip ninja-build gcc | |
fi | |
- uses: actions/checkout@v4 | |
- run: pip3 install colcon-package-information | |
- run: pip3 install meson==${{ matrix.meson_version }} | |
if: ${{ matrix.meson_version != 'latest' && matrix.meson_version != 'native' }} | |
- run: pip3 install --upgrade meson | |
if: ${{ matrix.meson_version == 'latest' }} | |
- run: pip3 install . | |
- name: list | |
working-directory: test/meson_test_project | |
run: | | |
test "$(colcon list --names-only)" = "meson_test_project" | |
- name: build | |
working-directory: test/meson_test_project | |
run: | | |
colcon build | |
test -f install/meson_test_project/bin/meson_test_project |