Skip to content

Commit

Permalink
Merge pull request #371 from HLasse/simplify-ci
Browse files Browse the repository at this point in the history
ci: simplified CI
  • Loading branch information
KennethEnevoldsen authored Dec 15, 2024
2 parents c078f4f + cdeb144 commit bb07e1b
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 170 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install ".[docs,tutorials]"
# if there is doc or tutorial requirements.txt file then install it
if [ -f ./docs/tutorials/requirements.txt ]; then
pip install -r ./docs/tutorials/requirements.txt
fi
if [ -f ./docs/requirements.txt ]; then
pip install -r ./docs/requirements.txt
fi
pip install -r ./docs/tutorials/requirements.txt
- name: Build and Commit
uses: sphinx-notes/[email protected]
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,24 @@ jobs:
python -m pip install --upgrade pip
# Assumes the package have the tests extra
pip install ".[tests]"
# if there is a ./tests/requirements.txt file then install it
if [ -f ./tests/requirements.txt ]; then
pip install -r ./tests/requirements.txt
fi
pip install -r ./tests/requirements.txt
- name: Run and write pytest
shell: bash
run: |
set -o pipefail
pytest --cov=textdescriptives --cov-report term-missing | tee pytest-coverage.txt
pytest
- name: Install dependencies for notebooks
shell: bash
run: |
# Assumes the package have the tutorials extra
pip install ".[tutorials]"
# if there is a tutorials requirements.txt file then install it
if [ -f ./tests/requirements.txt ]; then
pip install -r ./docs/tutorials/requirements.txt
fi
pip install -r ./docs/tutorials/requirements.txt
- name: Convert and run notebooks
shell: bash
run: |
jupyter nbconvert --to python ./docs/tutorials/*.ipynb
for f in docs/tutorials/*.py; do ipython "$f"; done
- name: Check the output coverage
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
shell: bash
run: |
echo "Coverage Report - ${{ steps.coverage-comment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverage-comment.outputs.color }}"
28 changes: 28 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
install:
@echo "--- 🚀 Installing project ---"
uv sync --extra docs --extra tests --extra style --extra style

lint:
@echo "--- 🧹 Running linters ---"
ruff format . # running ruff formatting
ruff check **/*.py --fix # running ruff linting

lint-check:
@echo "--- 🧹 Check is project is linted ---"
ruff format . --check # running ruff formatting
ruff check **/*.py # running ruff linting

test:
@echo "--- 🧪 Running tests ---"
make install
pytest tests/

build-docs:
@echo "--- 📚 Building docs ---"
@echo "Builds the docs and puts them in the 'site' folder"
sphinx-build -M html docs/ docs/_build

view-docs:
@echo "--- 👀 Viewing docs ---"
@echo You might need to rebuild the docs first"
open docs/_build/html/index.html
Loading

0 comments on commit bb07e1b

Please sign in to comment.