Skip to content

Rustify: remove unused assert(No)Exception (#1111) #2460

Rustify: remove unused assert(No)Exception (#1111)

Rustify: remove unused assert(No)Exception (#1111) #2460

Workflow file for this run

name: C++
on:
push:
branches: [main]
pull_request:
env:
CABIN_TERM_COLOR: always
permissions:
contents: read
jobs:
build-and-test:
name: "build & test (${{ matrix.cxx.name }})"
runs-on: ${{ matrix.cxx.os }}
strategy:
fail-fast: false
matrix:
cxx:
- name: "Clang 16"
cmd: clang++-16
os: ubuntu-24.04
- name: "Clang 17"
cmd: clang++-17
os: ubuntu-24.04
- name: "Clang 18"
cmd: clang++-18
os: ubuntu-24.04
- name: "Clang 19"
cmd: clang++-19
os: ubuntu-24.04
- name: "GCC 12"
cmd: g++-12
os: ubuntu-24.04
- name: "GCC 13"
cmd: g++-13
os: ubuntu-24.04
- name: "GCC 14"
cmd: g++-14
os: ubuntu-24.04
- name: "Apple Clang - macOS 13"
cmd: c++
os: macos-13
- name: "Apple Clang - macOS 14"
cmd: c++
os: macos-14
- name: "Apple Clang - macOS 15"
cmd: c++
os: macos-15
env:
CXX: ${{ matrix.cxx.cmd }}
steps:
- uses: actions/checkout@v4
- name: Setup Clang
if: matrix.cxx.cmd == 'clang++-19'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh "${CXX##*-}"
- name: Setup GCC
if: matrix.cxx.cmd == 'g++-15'
run: sudo apt update && sudo apt install -y "gcc-${CXX##*-}"
- name: Setup Ubuntu dependencies
if: runner.os == 'Linux'
uses: ./.github/actions/setup-ubuntu-deps
- name: Setup macOS dependencies
if: runner.os == 'macOS'
uses: ./.github/actions/setup-macos-deps
- name: Setup Sharness
run: |
wget https://raw.githubusercontent.com/felipec/sharness/refs/tags/v1.2.1/sharness.sh
wget https://raw.githubusercontent.com/felipec/sharness/refs/tags/v1.2.1/lib-sharness/functions.sh
mv sharness.sh tests/
mkdir tests/lib-sharness
mv functions.sh tests/lib-sharness/
- name: Print versions
run: make versions
- name: Stage 1 - Build
run: make -j4
- name: Stage 1 - Print version
run: ./build/cabin version --verbose
- name: Stage 1 - Test
run: make test -j4
- name: Stage 1 - Integration Test
run: find tests -maxdepth 1 -name '[0-9]*.sh' -print0 | xargs -0 -I {} sh -c 'sh {} -v'
env:
CABIN_TERM_COLOR: auto
- name: Stage 2 - Build & Test
run: ./build/cabin --verbose run test --verbose
- name: Stage 2 - Print version
run: ./cabin-out/debug/cabin version --verbose
- name: Stage 2 - Integration Test
run: find tests -maxdepth 1 -name '[0-9]*.sh' -print0 | xargs -0 -I {} sh -c 'sh {} -v'
env:
CABIN_BIN: ${{ github.workspace }}/cabin-out/debug/cabin
CABIN_TERM_COLOR: auto
# - name: Print coverage
# if: success() && matrix.coverage == 'on'
# run: |
# lcov --directory . --capture --output-file coverage.info --gcov-tool "${CC_PATH/gcc/gcov}"
# lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
# lcov --list coverage.info
# env:
# CC_PATH: /usr/bin/${{ env.CC }}
format:
needs: build-and-test
runs-on: ubuntu-24.04
env:
CXX: clang++-18
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build Cabin
run: make RELEASE=1
- name: Install clang-format
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 19
sudo apt-get install -y clang-format-19
- name: cabin fmt
run: ./build/cabin fmt --check --verbose
env:
CABIN_FMT: clang-format-19
lint:
needs: build-and-test
runs-on: ubuntu-24.04
env:
CXX: clang++-18
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build Cabin
run: make RELEASE=1
- uses: actions/setup-python@v5
with:
python-version: '3.*'
- name: Install cpplint
run: pip install cpplint
- name: Show cpplint version
run: cpplint --version
- name: cabin lint
run: ./build/cabin lint --verbose
clang-tidy:
needs: build-and-test
runs-on: ubuntu-24.04
env:
CXX: clang++-18
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build Cabin
run: make RELEASE=1
- name: Install clang-tidy
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 19
sudo apt-get install -y clang-tidy-19
- name: cabin tidy
run: ./build/cabin tidy --verbose
env:
CABIN_TIDY: clang-tidy-19