TermColor: colorize only term #2392
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: C++ | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
env: | |
CABIN_TERM_COLOR: always | |
permissions: | |
contents: read | |
jobs: | |
format: | |
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: | |
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 | |
build-and-test: | |
name: "build & test (${{ matrix.compiler.name }})" | |
runs-on: ${{ matrix.compiler.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: | |
- name: "Clang 16" | |
cxx: clang++-16 | |
os: ubuntu-24.04 | |
- name: "Clang 17" | |
cxx: clang++-17 | |
os: ubuntu-24.04 | |
- name: "Clang 18" | |
cxx: clang++-18 | |
os: ubuntu-24.04 | |
- name: "Clang 19" | |
cxx: clang++-19 | |
os: ubuntu-24.04 | |
- name: "GCC 12" | |
cxx: g++-12 | |
os: ubuntu-24.04 | |
- name: "GCC 13" | |
cxx: g++-13 | |
os: ubuntu-24.04 | |
- name: "GCC 14" | |
cxx: g++-14 | |
os: ubuntu-24.04 | |
- name: "Apple Clang - macOS 13" | |
cxx: c++ | |
os: macos-13 | |
- name: "Apple Clang - macOS 14" | |
cxx: c++ | |
os: macos-14 | |
- name: "Apple Clang - macOS 15" | |
cxx: c++ | |
os: macos-15 | |
env: | |
CXX: ${{ matrix.compiler.cxx }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Clang | |
if: matrix.compiler.cxx == 'clang++-19' | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x ./llvm.sh | |
sudo ./llvm.sh "${CXX##*-}" | |
- name: Setup GCC | |
if: matrix.compiler.cxx == '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' -exec 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' -exec 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 }} | |
clang-tidy: | |
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 |