From 3ddb0793906e29283daa2d6b590710841b5345c8 Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Wed, 30 Apr 2025 16:42:02 +0100 Subject: [PATCH 1/5] Use conda version of libsemigroups --- .github/workflows/tests.yml | 187 ++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 92 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1dfaa4b9..a658b9ae 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,120 +6,58 @@ 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 - with: - environment-name: libsemigroups - create-args: >- - python=${{ matrix.python_version }} - fmt - - 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 . . ." - 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 . . ." - 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 . . ." - run: | - pip3 install pylint cpplint - - name: "Running pylint and cpplint . . ." - run: | - python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py - python -m cpplint src/*.hpp src/*.cpp - macosx: - strategy: - fail-fast: false - matrix: - python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - runs-on: macOS-latest - timeout-minutes: 15 - env: - CXX: "ccache clang++" - CXXFLAGS: "-O2 -g" - steps: - - uses: actions/checkout@v4 - - name: "Create micromamba environment" + # We could remove this step and instead install Python with micromamba. + # This would mean we could avoid specifying LD_LIBRARY_PATH and LDFLAGS. + # However, JDE thinks the current setup better reflects how a developer + # might wish to install the package, so we have opted for this. + - name: "Setup Python . . ." + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_version }} + cache: "pip" + - name: "Create micromamba environment . . ." uses: mamba-org/setup-micromamba@v1 with: environment-name: libsemigroups create-args: >- - python=${{ matrix.python_version }} - fmt + 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 + echo "LDFLAGS=-Wl,-rpath,$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib" >> $GITHUB_ENV echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV - - name: "Install libsemigroups dependencies . . ." - 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 - cd libsemigroups - ./autogen.sh - ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt - sudo make install -j8 - ccache -s - - name: "Python version . . ." + - 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 + - name: "Run tests . . ." run: | python -m pytest -vv tests/test_*.py - name: "Run doc tests . . ." @@ -127,10 +65,75 @@ jobs: 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: + # strategy: + # fail-fast: false + # matrix: + # python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + # runs-on: macOS-latest + # 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 + # with: + # environment-name: libsemigroups + # create-args: >- + # python=${{ matrix.python_version }} + # fmt + # - 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 "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV + # - name: "Install libsemigroups dependencies . . ." + # 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 + # cd libsemigroups + # ./autogen.sh + # ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt + # sudo make install -j8 + # ccache -s + # - name: "Python version . . ." + # 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 . . ." + # 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 . . ." + # run: | + # pip3 install pylint cpplint + # - name: "Running pylint and cpplint . . ." + # run: | + # python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py + # python -m cpplint src/*.hpp src/*.cpp From 0d514d80e361f610831d95578c6ebcb32f145f63 Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Thu, 1 May 2025 03:03:49 +0100 Subject: [PATCH 2/5] Add main branch test --- .github/workflows/tests.yml | 141 +++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 65 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a658b9ae..8eaa4ca4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,68 +72,79 @@ jobs: run: | python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py python -m cpplint src/*.hpp src/*.cpp - # macosx: - # strategy: - # fail-fast: false - # matrix: - # python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - # runs-on: macOS-latest - # 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 - # with: - # environment-name: libsemigroups - # create-args: >- - # python=${{ matrix.python_version }} - # fmt - # - 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 "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV - # - name: "Install libsemigroups dependencies . . ." - # 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 - # cd libsemigroups - # ./autogen.sh - # ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt - # sudo make install -j8 - # ccache -s - # - name: "Python version . . ." - # 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 . . ." - # 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 . . ." - # run: | - # pip3 install pylint cpplint - # - name: "Running pylint and cpplint . . ." - # run: | - # python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py - # python -m cpplint src/*.hpp src/*.cpp + main-branch: + name: "Main, ${{ 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 + # We could remove this step and instead install Python with micromamba. + # This would mean we could avoid specifying LD_LIBRARY_PATH and LDFLAGS. + # However, JDE thinks the current setup better reflects how a developer + # might wish to install the package, so we have opted for this. + - name: "Setup Python . . ." + uses: actions/setup-python@v5 + with: + python-version: 3.13 + cache: "pip" + - name: "Create micromamba environment . . ." + uses: mamba-org/setup-micromamba@v1 + with: + environment-name: libsemigroups + create-args: >- + fmt + - 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 "LDFLAGS=-Wl,-rpath,$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib" >> $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 . . ." + if: ${{ matrix.os == 'macOS-latest' }} + run: brew install autoconf automake libtool + - name: "Install requirements libsemigroups . . ." + run: pip install -r requirements.txt + - 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" --disable-hpcombi --with-external-fmt + sudo make install -j8 + ccache -s + - name: "Pip install libsemigroups_pybind11 . . ." + run: | + CXX="${{ matrix.compiler }}" pip install . -v + - 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 From 91e4179f9ea6209fe7595d6c596389fc09edab6b Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Thu, 1 May 2025 03:21:38 +0100 Subject: [PATCH 3/5] Add workflow to run on specific branch and fork --- .github/workflows/custom-branch.yml | 95 +++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/custom-branch.yml diff --git a/.github/workflows/custom-branch.yml b/.github/workflows/custom-branch.yml new file mode 100644 index 00000000..3cfa95fd --- /dev/null +++ b/.github/workflows/custom-branch.yml @@ -0,0 +1,95 @@ +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 + # We could remove this step and instead install Python with micromamba. + # This would mean we could avoid specifying LD_LIBRARY_PATH and LDFLAGS. + # However, JDE thinks the current setup better reflects how a developer + # might wish to install the package, so we have opted for this. + - name: "Setup Python . . ." + uses: actions/setup-python@v5 + with: + python-version: 3.13 + cache: "pip" + - name: "Create micromamba environment . . ." + uses: mamba-org/setup-micromamba@v1 + with: + environment-name: libsemigroups + create-args: >- + fmt + - 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 "LDFLAGS=-Wl,-rpath,$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib" >> $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 . . ." + if: ${{ matrix.os == 'macOS-latest' }} + run: brew install autoconf automake libtool + - name: "Install requirements libsemigroups . . ." + run: pip install -r requirements.txt + - name: "Install libsemigroups . . ." + run: | + git clone --depth 1 --branch ${{ inputs.branch }} https://github.com/${{ inputs.fork }}.git + cd libsemigroups + ./autogen.sh + ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt + sudo make install -j8 + ccache -s + - name: "Pip install libsemigroups_pybind11 . . ." + run: | + CXX="${{ matrix.compiler }}" pip install . -v + - 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 From c578661cb181816cd987b47aad188261010f8f7a Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Thu, 1 May 2025 03:36:41 +0100 Subject: [PATCH 4/5] Use ccache --- .github/workflows/custom-branch.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/custom-branch.yml b/.github/workflows/custom-branch.yml index 3cfa95fd..7a61ddb3 100644 --- a/.github/workflows/custom-branch.yml +++ b/.github/workflows/custom-branch.yml @@ -72,7 +72,7 @@ jobs: git clone --depth 1 --branch ${{ inputs.branch }} https://github.com/${{ inputs.fork }}.git cd libsemigroups ./autogen.sh - ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi --with-external-fmt + ./configure CXX="${{ matrix.compiler }}" CXXFLAGS="-O2 -g" --disable-hpcombi --with-external-fmt sudo make install -j8 ccache -s - name: "Pip install libsemigroups_pybind11 . . ." diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8eaa4ca4..70c20f24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -127,7 +127,7 @@ jobs: 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 + ./configure CXX="${{ matrix.compiler }}" CXXFLAGS="-O2 -g" --disable-hpcombi --with-external-fmt sudo make install -j8 ccache -s - name: "Pip install libsemigroups_pybind11 . . ." From 57f3ef0a5de33d3ca1c22a4fc0b67f87fe985ffe Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Thu, 1 May 2025 13:32:01 +0100 Subject: [PATCH 5/5] Use micromamba for python --- .github/workflows/custom-branch.yml | 27 ++++++++---------- .github/workflows/tests.yml | 44 +++++++++++------------------ 2 files changed, 27 insertions(+), 44 deletions(-) diff --git a/.github/workflows/custom-branch.yml b/.github/workflows/custom-branch.yml index 7a61ddb3..f19df10e 100644 --- a/.github/workflows/custom-branch.yml +++ b/.github/workflows/custom-branch.yml @@ -37,47 +37,42 @@ jobs: with: update_packager_index: false install_ccache: true - # We could remove this step and instead install Python with micromamba. - # This would mean we could avoid specifying LD_LIBRARY_PATH and LDFLAGS. - # However, JDE thinks the current setup better reflects how a developer - # might wish to install the package, so we have opted for this. - - name: "Setup Python . . ." - uses: actions/setup-python@v5 - with: - python-version: 3.13 - cache: "pip" - name: "Create micromamba environment . . ." - uses: mamba-org/setup-micromamba@v1 + 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" >> $GITHUB_ENV - echo "LDFLAGS=-Wl,-rpath,$MAMBA_ROOT_PREFIX/envs/libsemigroups/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: "Check Python version . . ." run: | python --version pip --version - - name: "Install make requirements . . ." + - name: "Install make requirements (Mac only) . . ." if: ${{ matrix.os == 'macOS-latest' }} run: brew install autoconf automake libtool - - name: "Install requirements libsemigroups . . ." - run: pip install -r requirements.txt - 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 + ./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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 70c20f24..b9d43a1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,26 +27,18 @@ jobs: with: update_packager_index: false install_ccache: true - # We could remove this step and instead install Python with micromamba. - # This would mean we could avoid specifying LD_LIBRARY_PATH and LDFLAGS. - # However, JDE thinks the current setup better reflects how a developer - # might wish to install the package, so we have opted for this. - - name: "Setup Python . . ." - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python_version }} - cache: "pip" - name: "Create micromamba environment . . ." - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: environment-name: libsemigroups + cache-environment: true create-args: >- + python=${{ matrix.python_version }} + 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 - echo "LDFLAGS=-Wl,-rpath,$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib" >> $GITHUB_ENV echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV - name: "Check Python version . . ." run: | @@ -57,6 +49,7 @@ jobs: - 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 @@ -92,47 +85,42 @@ jobs: with: update_packager_index: false install_ccache: true - # We could remove this step and instead install Python with micromamba. - # This would mean we could avoid specifying LD_LIBRARY_PATH and LDFLAGS. - # However, JDE thinks the current setup better reflects how a developer - # might wish to install the package, so we have opted for this. - - name: "Setup Python . . ." - uses: actions/setup-python@v5 - with: - python-version: 3.13 - cache: "pip" - name: "Create micromamba environment . . ." - uses: mamba-org/setup-micromamba@v1 + 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" >> $GITHUB_ENV - echo "LDFLAGS=-Wl,-rpath,$MAMBA_ROOT_PREFIX/envs/libsemigroups/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: "Check Python version . . ." run: | python --version pip --version - - name: "Install make requirements . . ." + - name: "Install make requirements (Mac only) . . ." if: ${{ matrix.os == 'macOS-latest' }} run: brew install autoconf automake libtool - - name: "Install requirements libsemigroups . . ." - run: pip install -r requirements.txt - name: "Install libsemigroups . . ." run: | git clone --depth 1 --branch main https://github.com/libsemigroups/libsemigroups.git cd libsemigroups ./autogen.sh - ./configure CXX="${{ matrix.compiler }}" CXXFLAGS="-O2 -g" --disable-hpcombi --with-external-fmt + ./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