Skip to content

Commit f10d354

Browse files
ci: add job to check compile flags
1 parent 425a6c3 commit f10d354

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)