build(deps): bump actions/checkout from 3 to 4 #735
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: C/C++ CI | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: master | |
paths: | |
- '**' | |
- '!**.yml' | |
- '!**/.github' | |
- '!**.md' | |
- '!docker/**' | |
- '!packaging/**' | |
- '**/c-cpp.yml' | |
pull_request: | |
branches: master | |
paths: | |
- '**' | |
- '!**.yml' | |
- '!**/.github' | |
- '!**.md' | |
- '!docker/**' | |
- '!packaging/**' | |
- '**/c-cpp.yml' | |
env: | |
TERM: xterm | |
jobs: | |
build: | |
name: ${{ matrix.build.name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build: | |
- name: ubuntu-20.04-gcc | |
os: ubuntu-20.04 | |
cc: gcc | |
dist: true | |
- name: ubuntu-20.04-clang | |
os: ubuntu-20.04 | |
cc: clang | |
- name: ubuntu-22.04-gcc | |
os: ubuntu-22.04 | |
cc: gcc | |
- name: ubuntu-22.04-clang | |
os: ubuntu-22.04 | |
cc: clang | |
- name: Slackware | |
os: ubuntu-20.04 | |
container: 'andy5995/slackware-build-essential:15.0' | |
- name: debian bullseye | |
os: ubuntu-20.04 | |
container: 'andy5995/rmw-build-env:bullseye' | |
- name: ubuntu-22.04-without-nls | |
os: ubuntu-22.04 | |
setup: -Dnls=false | |
- name: ubuntu-22.04-without-curses | |
os: ubuntu-22.04 | |
setup: -Dwithout-curses=true | |
- name: Alpine | |
os: ubuntu-22.04 | |
container: andy5995/rmw-build-env:alpine | |
setup: -Db_sanitize=none | |
- name: macos-latest-brew-canfigger | |
os: macos-latest | |
install_packages: canfigger | |
- name: macos-latest-bundled-canfigger | |
os: macos-latest | |
runs-on: ${{ matrix.build.os }} | |
container: ${{ matrix.build.container }} | |
env: | |
CC: '${{ matrix.build.cc }}' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- if: ${{ env.CC }} | |
run: | | |
if [ "$CC" = "gcc" ]; then | |
CXX=g++ | |
else | |
CXX=clang++ | |
fi | |
echo "CXX=${CXX}" >> $GITHUB_ENV | |
- name: Show info | |
run: | | |
export -p | |
echo '${{ toJSON(matrix) }}' | |
- if: ${{ contains(matrix.build.os, 'macos') }} | |
run: | | |
pip3 install meson ninja | |
brew install \ | |
ncurses \ | |
pkg-config \ | |
${{ matrix.build.install_packages }} | |
#- if: ${{ contains(matrix.os, 'ubuntu') }} | |
#run: | | |
#sudo apt-get update -qq | |
#sudo apt-get upgrade -y -qq | |
#- if: ${{ matrix.cc == 'clang' && matrix.os != 'macos-latest' }} | |
#run: sudo apt-get install -y $CC $CXX | |
- if: ${{ contains(matrix.build.os, 'ubuntu') && matrix.build.container == null }} | |
run: | | |
sudo apt-get install -y \ | |
python3-pip \ | |
python3-setuptools | |
sudo -H python3 -m pip install meson ninja | |
- if: ${{ contains(matrix.build.name, 'without-nls') && matrix.build.container == null }} | |
run: sudo apt remove -y gettext | |
- if: ${{ contains(matrix.build.name, 'without-nls') == false && matrix.build.container == null && contains(matrix.build.os, 'macos') == false }} | |
run: sudo apt install -y gettext | |
- name: Configure | |
run: meson setup builddir ${{ matrix.build.setup }} | |
- name: Build | |
run: | | |
cd builddir | |
ninja -v | |
- name: Test | |
run: cd builddir && meson test -v | |
- name: Test fake media root | |
run: cd builddir && meson test -v --setup=fake_media_root --suite rmw | |
- if: ${{ contains(matrix.build.name, 'dist') }} | |
run: cd builddir && meson dist --include-subprojects | |
openbsd: | |
runs-on: macos-12 | |
name: A job to run test in OpenBSD | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Test in OpenBSD | |
id: test | |
uses: vmactions/openbsd-vm@v0 | |
with: | |
usesh: true | |
prepare: | | |
pkg_add gettext meson ninja | |
run: | | |
meson setup builddir -Db_sanitize=none || cat builddir/meson-logs/meson-log.txt | |
cd builddir | |
meson compile -v | |
meson test -v --suite rmw |