Skip to content

test building the example project #73

test building the example project

test building the example project #73

Workflow file for this run

---
name: Run tests
on:
push:
branches: ['main']
pull_request:
jobs:
pytest:
uses: colcon/ci/.github/workflows/pytest.yaml@main
meson:
name: "Meson API (Meson: ${{ matrix.version }})"
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: "Build (${{ matrix.linux_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", "ubuntu:24.04"]
exclude:
- { linux_version: "almalinux:8", meson_version: "1.3" }
- { linux_version: "almalinux:8", meson_version: "native" } # 0.58.2
- { linux_version: "ubuntu:20.04", meson_version: "native" } # 0.53.2
include:
- { linux_version: "ubuntu:24.04", pip_args: "--break-system-packages" }
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 meson 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 meson ninja-build gcc
fi
- uses: actions/checkout@v4
- run: pip3 install ${{ matrix.pip_args }} colcon-package-information
- run: pip3 install ${{ matrix.pip_args }} --user meson==${{ matrix.meson_version }}
if: ${{ matrix.meson_version != 'latest' && matrix.meson_version != 'native' }}
- run: pip3 install ${{ matrix.pip_args }} --user --upgrade meson
if: ${{ matrix.meson_version == 'latest' }}
- run: pip3 install --no-deps .
# - run: pip3 uninstall -y meson
# if: ${{ matrix.meson_version == 'native' }}
# - name: install Meson
# shell: bash
# run: |
# if command -v apt &> /dev/null; then
# apt update && apt -y install meson
# fi
# if command -v dnf &> /dev/null; then
# dnf -y install meson
# fi
- name: show version information
run: |
python3 --version
pip3 show meson
- 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