Skip to content

Commit 9493e2d

Browse files
Replace workflows with actions
1 parent 16cc816 commit 9493e2d

File tree

4 files changed

+99
-125
lines changed

4 files changed

+99
-125
lines changed

.github/actions/tests/action.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: "test"
2+
description: "Run the tests and lint"
3+
inputs:
4+
operating_system:
5+
description: "OS of the runner"
6+
required: true
7+
python_version:
8+
description: "Python version used by the runner"
9+
runs:
10+
using: "composite"
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: "Create micromamba environment"
14+
uses: mamba-org/setup-micromamba@v1
15+
with:
16+
environment-name: libsemigroups
17+
create-args: >-
18+
python=${{ input.python_version }}
19+
fmt
20+
- name: "Set environment variables . . ."
21+
run: |
22+
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/libsemigroups/share/pkgconfig:/usr/local/lib/pkgconfig" >> $GITHUB_ENV
23+
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/lib:/usr/local/lib" >> $GITHUB_ENV
24+
shell: bash -l {0}
25+
- name: "Add Python to path . . ."
26+
run: |
27+
echo "PATH=$MAMBA_ROOT_PREFIX/envs/libsemigroups/bin:$PATH" >> $GITHUB_ENV
28+
shell: bash -l {0}
29+
if: ${{ inputs.operating_system == 'macOS-latest'}}
30+
- name: "Install libsemigroups dependencies . . ."
31+
run: |
32+
brew install autoconf automake
33+
shell: bash -l {0}
34+
if: ${{ inputs.operating_system == 'macOS-latest' }}
35+
- name: "Install libsemigroups . . ."
36+
run: |
37+
git clone --depth 1 --branch v3 https://github.com/libsemigroups/libsemigroups.git
38+
cd libsemigroups
39+
./autogen.sh && ./configure CXXFLAGS='-O3 -g' --disable-hpcombi --with-external-fmt && sudo make install -j8
40+
shell: bash -l {0}
41+
- name: "Python version . . ."
42+
run: |
43+
python --version
44+
pip3 --version
45+
shell: bash -l {0}
46+
- name: "Pip installing requirements.txt . . ."
47+
run: |
48+
pip3 install -r requirements.txt
49+
shell: bash -l {0}
50+
- name: "Pip3 installing libsemigroups_pybind11 . . ."
51+
run: |
52+
pip3 install . -v
53+
shell: bash -l {0}
54+
- name: "python -m pytest -vv tests/test_*.py . . ."
55+
run: |
56+
python -m pytest -vv tests/test_*.py
57+
shell: bash -l {0}
58+
- name: "Run doc tests . . ."
59+
run: |
60+
etc/make-doc.sh # so that all files are generated!
61+
cd docs
62+
python -m sphinx -b doctest -d _build/doctrees source _build/doctest
63+
shell: bash -l {0}
64+
- name: "Pip3 installing pylint + cpplint . . ."
65+
run: |
66+
pip3 install pylint cpplint
67+
shell: bash -l {0}
68+
- name: "Running pylint and cpplint . . ."
69+
run: |
70+
python -m pylint setup.py tests/*.py libsemigroups_pybind11/*.py
71+
python -m cpplint src/*.hpp src/*.cpp
72+
shell: bash -l {0}

.github/workflows/codespell.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check CI
2+
on: [pull_request, workflow_dispatch]
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
jobs:
9+
codespell:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: codespell-project/actions-codespell@v1.0
14+
ubuntu:
15+
needs: codespell
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20+
os: [ubuntu-latest, macOS-latest]
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 15
23+
steps:
24+
- uses: ./.github/actions/tests
25+
with:
26+
operating_system: ${{ matrix.os }}
27+
python_version: ${{ matrix.python_version }}

.github/workflows/tests.yml

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)