Skip to content

Add a CI workflow that tests the packaging using libsemigroups installed with a combination of --disable-eigen and --disable-hpcombi #48

Add a CI workflow that tests the packaging using libsemigroups installed with a combination of --disable-eigen and --disable-hpcombi

Add a CI workflow that tests the packaging using libsemigroups installed with a combination of --disable-eigen and --disable-hpcombi #48

Workflow file for this run

name: Lint
on: [pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
compiler: g++
- os: macOS-latest
compiler: clang++
runs-on: ${{ matrix.os }}
timeout-minutes: 15
defaults:
run:
shell: bash -l {0}
env:
CXX: "ccache ${{ matrix.compiler }}"
CXXFLAGS: "-O2 -g"
UV_NO_SYNC: "1"
LD_LIBRARY_PATH: "/usr/local/lib"
steps:
# Setup environment
- uses: actions/checkout@v5
- name: Set up Python . . .
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install uv . . .
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: "Install libsemigroups_pybind11 dependencies . . ."
run: uv sync --verbose --locked --no-install-project --no-dev --group lint
- name: "Find the names of the Python files that will be linted"
run: echo "PYTHON_FILES=$(uv run ruff check --show-files | grep '\.py$' | tr -s '\n' ' ')" >> $GITHUB_ENV
# Lint with ruff and cpplint
- name: "Lint with ruff . . ."
run: uv run ruff check
- name: "Check ruff formatting . . ."
run: uv run ruff format --diff
- name: "Lint with cpplint . . ."
run: uv run cpplint src/*.hpp src/*.cpp
# Build libsemigroups
- name: "macOS only: Install libsemigroups dependencies . . ."
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install autoconf automake libtool
- name: "Setup ccache . . ."
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
install_ccache: true
- name: "Install libsemigroups . . ."
run: |
git clone --depth 1 --branch main https://github.com/libsemigroups/libsemigroups.git
cd libsemigroups
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" && sudo make install -j4
ccache -s
# Build libsemigroups_pybind11
- name: "Install libsemigroups_pybind11 . . ."
run: uv sync --verbose --locked --all-extras --no-dev --group lint
# Lint with ruff and cpplint
- name: "Lint with pylint . . ."
run: uv run pylint $PYTHON_FILES