diff --git a/.github/workflows/custom-branch.yml b/.github/workflows/custom-branch.yml new file mode 100644 index 00000000..ac199374 --- /dev/null +++ b/.github/workflows/custom-branch.yml @@ -0,0 +1,74 @@ +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 }}" + 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 + 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 and set the Python version + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + + # 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 ${{ inputs.branch }} https://github.com/${{ inputs.fork }}.git + cd libsemigroups + ./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi && sudo make install -j8 + ccache -s + + # Build libsemigroups_pybind11 + - name: "Install libsemigroups_pybind11 . . ." + run: uv sync --locked --all-extras + + # Run the tests and lint + - name: "Running tests . . ." + run: uv run pytest + - name: "Running doc tests . . ." + run: uv run make doctest diff --git a/.github/workflows/test-conda.yml b/.github/workflows/test-conda.yml new file mode 100644 index 00000000..e8c27e24 --- /dev/null +++ b/.github/workflows/test-conda.yml @@ -0,0 +1,65 @@ +name: Run tests (Conda libsemigroups) +on: [pull_request, workflow_dispatch] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-doc: + 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 }}" + UV_NO_SYNC: "1" + steps: + # Setup environment + - uses: actions/checkout@v5 + - name: Create micromamba environment . . . + uses: mamba-org/setup-micromamba@v2 + with: + environment-name: libsemigroups + cache-environment: true + create-args: >- + python + libsemigroups + - name: Install uv . . . + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Setup ccache . . . + uses: Chocobo1/setup-ccache-action@v1 + with: + update_packager_index: false + install_ccache: true + - 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 "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV + - name: Check Python version . . . + run: python --version + + # Build libsemigroups_pybind11 + - name: "Install libsemigroups_pybind11 . . ." + run: uv sync --locked --all-extras --no-dev --group lint + + # Run the tests and lint + - name: "Running tests . . ." + run: uv run pytest + - name: "Running doc tests . . ." + run: | + uv run etc/make-doc.sh # so that all files are generated! + cd docs + uv run python -m sphinx -b doctest -d _build/doctrees source _build/doctest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 98d33d14..726fd87d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Run tests and lint +name: Run tests and lint (GitHub libsemigroups) on: [pull_request, workflow_dispatch] concurrency: