|
| 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} |
0 commit comments