Skip to content

Use conda version of libsemigroups in the CI #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/custom-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Run tests on custom libsemigroups branch
on:
workflow_dispatch:
inputs:
branch:
description: "The branch of libsemigroups to clone"
required: true
type: string
fork:
description: "The fork of libsemigroups to clone"
required: false
type: string
default: libsemigroups/libsemigroups

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run-tests:
name: "${{ inputs.branch }}, ${{ matrix.os }}, Python 3.13"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macOS-latest"]
include:
- os: "ubuntu-latest"
compiler: "ccache g++"
- os: "macOS-latest"
compiler: "ccache clang++"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: "Setup ccache . . ."
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
install_ccache: true
- name: "Create micromamba environment . . ."
uses: mamba-org/setup-micromamba@v2
with:
environment-name: libsemigroups
cache-environment: true
create-args: >-
python=3.13
pip
fmt
eigen
- name: "Set environment variables . . ."
run: |
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/libsemigroups/share/pkgconfig:/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV
- name: "Check Python version . . ."
run: |
python --version
pip --version
- name: "Install make requirements (Mac only) . . ."
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install autoconf automake libtool
- name: "Install libsemigroups . . ."
run: |
git clone --depth 1 --branch ${{ inputs.branch }} https://github.com/${{ inputs.fork }}.git
cd libsemigroups
./autogen.sh
./configure CXX="${{ matrix.compiler }}" CXXFLAGS="-O2 -g" --disable-hpcombi --with-external-fmt --with-external-eigen
sudo make install -j8
ccache -s
- name: "Install requirements libsemigroups . . ."
run: pip install -r requirements.txt
- name: "Pip install libsemigroups_pybind11 . . ."
run: |
CXX="${{ matrix.compiler }}" pip install . -v
ccache -s
- name: "Run tests . . ."
run: |
python -m pytest -vv tests/test_*.py
- name: "Run doc tests . . ."
run: |
etc/make-doc.sh # so that all files are generated!
cd docs
python -m sphinx -b doctest -d _build/doctrees source _build/doctest
- name: "Pip install pylint + cpplint . . ."
run: |
pip install pylint cpplint
- name: "Run pylint and cpplint . . ."
run: |
python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py
python -m cpplint src/*.hpp src/*.cpp
136 changes: 69 additions & 67 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,131 +6,133 @@ concurrency:
cancel-in-progress: true

jobs:
ubuntu:
conda-version:
name: "Conda, ${{ matrix.os }}, Python ${{ matrix.python_version }}"
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
os: ["ubuntu-latest", "macOS-latest"]
include:
- os: "ubuntu-latest"
compiler: "ccache g++"
- os: "macOS-latest"
compiler: "ccache clang++"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
defaults:
run:
shell: bash -l {0}
env:
CXX: "ccache g++"
CXXFLAGS: "-O2 -g"
steps:
- uses: actions/checkout@v4
- name: "Create micromamba environment"
uses: mamba-org/setup-micromamba@v1
- name: "Setup ccache . . ."
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
install_ccache: true
- name: "Create micromamba environment . . ."
uses: mamba-org/setup-micromamba@v2
with:
environment-name: libsemigroups
cache-environment: true
create-args: >-
python=${{ matrix.python_version }}
fmt
pip
libsemigroups
- name: "Set environment variables . . ."
run: |
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/libsemigroups/share/pkgconfig:/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib" >> $GITHUB_ENV
- 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 stable-3.0 https://github.com/libsemigroups/libsemigroups.git
cd libsemigroups
./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt && sudo make install -j8
ccache -s
- name: "Python version . . ."
echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV
- name: "Check Python version . . ."
run: |
python --version
pip3 --version
- name: "Pip installing requirements.txt . . ."
run: |
pip3 install -r requirements.txt
- name: "Pip3 installing libsemigroups_pybind11 . . ."
pip --version
- name: "Install requirements . . ."
run: pip install -r requirements.txt
- name: "Pip install libsemigroups_pybind11 . . ."
run: |
echo $PKG_CONFIG_PATH
pip3 install . -v
- name: "python -m pytest -vv tests/test_*.py . . ."
CXX="${{ matrix.compiler }}" pip install . -v
ccache -s
- name: "Run tests . . ."
run: |
python -m pytest -vv tests/test_*.py
- name: "Run doc tests . . ."
run: |
etc/make-doc.sh # so that all files are generated!
cd docs
python -m sphinx -b doctest -d _build/doctrees source _build/doctest
- name: "Pip3 installing pylint + cpplint . . ."
- name: "Pip install pylint + cpplint . . ."
run: |
pip3 install pylint cpplint
- name: "Running pylint and cpplint . . ."
- name: "Run pylint and cpplint . . ."
run: |
python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py
python -m cpplint src/*.hpp src/*.cpp
macosx:
main-branch:
name: "Main, ${{ matrix.os }}, Python 3.13"
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: macOS-latest
os: ["ubuntu-latest", "macOS-latest"]
include:
- os: "ubuntu-latest"
compiler: "ccache g++"
- os: "macOS-latest"
compiler: "ccache clang++"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
CXX: "ccache clang++"
CXXFLAGS: "-O2 -g"
steps:
- uses: actions/checkout@v4
- name: "Create micromamba environment"
uses: mamba-org/setup-micromamba@v1
- name: "Setup ccache . . ."
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
install_ccache: true
- name: "Create micromamba environment . . ."
uses: mamba-org/setup-micromamba@v2
with:
environment-name: libsemigroups
cache-environment: true
create-args: >-
python=${{ matrix.python_version }}
python=3.13
pip
fmt
eigen
- name: "Set environment variables . . ."
run: |
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/libsemigroups/share/pkgconfig:/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV
- name: "Install libsemigroups dependencies . . ."
- name: "Check Python version . . ."
run: |
python --version
pip --version
- name: "Install make requirements (Mac only) . . ."
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 stable-3.0 https://github.com/libsemigroups/libsemigroups.git
git clone --depth 1 --branch main https://github.com/libsemigroups/libsemigroups.git
cd libsemigroups
./autogen.sh
./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt
./autogen.sh
./configure CXX="${{ matrix.compiler }}" CXXFLAGS="-O2 -g" --disable-hpcombi --with-external-fmt --with-external-eigen
sudo make install -j8
ccache -s
- name: "Python version . . ."
- name: "Install requirements libsemigroups . . ."
run: pip install -r requirements.txt
- name: "Pip install libsemigroups_pybind11 . . ."
run: |
python --version
pip3 --version
- name: "Pip installing requirements.txt . . ."
run: |
pip3 install -r requirements.txt
- name: "Pip3 installing libsemigroups_pybind11 . . ."
run: |
echo $PKG_CONFIG_PATH
pip3 install . -v
- name: "python -m pytest -vv tests/test_*.py . . ."
CXX="${{ matrix.compiler }}" pip install . -v
ccache -s
- name: "Run tests . . ."
run: |
python -m pytest -vv tests/test_*.py
- name: "Run doc tests . . ."
run: |
etc/make-doc.sh # so that all files are generated!
cd docs
python -m sphinx -b doctest -d _build/doctrees source _build/doctest
- name: "Pip3 installing pylint + cpplint . . ."
- name: "Pip install pylint + cpplint . . ."
run: |
pip3 install pylint cpplint
- name: "Running pylint and cpplint . . ."
pip install pylint cpplint
- name: "Run pylint and cpplint . . ."
run: |
python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py
python -m cpplint src/*.hpp src/*.cpp
Loading