|
| 1 | +name: Run tests on custom libsemigroups branch |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + branch: |
| 6 | + description: "The branch of libsemigroups to clone" |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + fork: |
| 10 | + description: "The fork of libsemigroups to clone" |
| 11 | + required: false |
| 12 | + type: string |
| 13 | + default: libsemigroups/libsemigroups |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + run-tests: |
| 21 | + name: "${{ inputs.branch }}, ${{ matrix.os }}" |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + os: ["ubuntu-latest", "macOS-latest"] |
| 26 | + include: |
| 27 | + - os: "ubuntu-latest" |
| 28 | + compiler: "ccache g++" |
| 29 | + - os: "macOS-latest" |
| 30 | + compiler: "ccache clang++" |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + timeout-minutes: 15 |
| 33 | + env: |
| 34 | + CXX: "ccache ${{ matrix.compiler }}" |
| 35 | + CXXFLAGS: "-O2 -g" |
| 36 | + UV_NO_SYNC: "1" |
| 37 | + LD_LIBRARY_PATH: "/usr/local/lib" |
| 38 | + steps: |
| 39 | + # Setup environment |
| 40 | + - uses: actions/checkout@v5 |
| 41 | + - name: Set up Python . . . |
| 42 | + uses: actions/setup-python@v6 |
| 43 | + with: |
| 44 | + python-version-file: "pyproject.toml" |
| 45 | + - name: Install uv and set the Python version |
| 46 | + uses: astral-sh/setup-uv@v6 |
| 47 | + with: |
| 48 | + enable-cache: true |
| 49 | + |
| 50 | + # Build libsemigroups |
| 51 | + - name: "macOS only: Install libsemigroups dependencies . . ." |
| 52 | + if: ${{ matrix.os == 'macOS-latest' }} |
| 53 | + run: brew install autoconf automake libtool |
| 54 | + - name: "Setup ccache . . ." |
| 55 | + uses: Chocobo1/setup-ccache-action@v1 |
| 56 | + with: |
| 57 | + update_packager_index: false |
| 58 | + install_ccache: true |
| 59 | + - name: "Install libsemigroups . . ." |
| 60 | + run: | |
| 61 | + git clone --depth 1 --branch ${{ inputs.branch }} https://github.com/${{ inputs.fork }}.git |
| 62 | + cd libsemigroups |
| 63 | + ./autogen.sh && ./configure CXX="$CXX" CXXFLAGS="$CXXFLAGS" --disable-hpcombi && sudo make install -j8 |
| 64 | + ccache -s |
| 65 | +
|
| 66 | + # Build libsemigroups_pybind11 |
| 67 | + - name: "Install libsemigroups_pybind11 . . ." |
| 68 | + run: uv sync --locked --all-extras |
| 69 | + |
| 70 | + # Run the tests and lint |
| 71 | + - name: "Running tests . . ." |
| 72 | + run: uv run pytest |
| 73 | + - name: "Running doc tests . . ." |
| 74 | + run: uv run make doctest |
0 commit comments