tagged-upversion #294
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: [ push, pull_request, workflow_dispatch ] | |
env: | |
PIP_CACHE_DIR: /tmp/pipcache | |
HOME_REPO: thebjorn/pydeps | |
jobs: | |
ci-lint: | |
name: CI:Lint | |
runs-on: ubuntu-latest | |
env: | |
LINTDIR: ./ghlint | |
steps: | |
# setup environment | |
- uses: actions/checkout@v4 | |
- name: setup directories | |
shell: bash | |
run: | | |
mkdir -p $PIP_CACHE_DIR | |
mkdir -p $LINTDIR | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- run: pip install flake8 | |
- run: flake8 pydeps/** --max-line-length=199 --exit-zero --exclude mf | |
docs: | |
name: CI:Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: setup directories | |
shell: bash | |
run: | | |
mkdir -p build | |
- run: pip install sphinx | |
- run: pip install -e . | |
- run: sphinx-build -W -b html docs build/sphinx/html | |
- run: sphinx-build -W -n -T -b man docs build/sphinx/man | |
- name: Upload docs as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Docs | |
path: build/sphinx/ | |
ci-test: | |
name: CI:Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ] | |
os: [ubuntu-latest] | |
include: | |
- python-version: '3.9' | |
os: windows-latest | |
# macos is just waay too slow... | |
# - python-version: '3.9' | |
# os: macos-latest | |
steps: | |
# setup environment | |
- uses: actions/checkout@v4 | |
- uses: ts-graphviz/setup-graphviz@v2 | |
- name: setup global directories | |
shell: bash | |
run: mkdir -p $PIP_CACHE_DIR | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install -r requirements.txt | |
- run: pip list | |
- run: pytest -vv --cov=pydeps --cov-report=xml tests | |
- name: Upload coverage to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN}} | |
fail_ci_if_error: false | |
cd: | |
name: CD | |
needs: ci-test | |
runs-on: ubuntu-latest | |
steps: | |
# setup environment | |
- uses: actions/checkout@v4 | |
- name: setup directories | |
shell: bash | |
run: mkdir -p $PIP_CACHE_DIR | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Cleanup | |
run: | | |
rm -rf dist | |
rm -rf build | |
- run: pip install -U build twine | |
- run: python -m build | |
- name: Upload packages as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Packages | |
path: dist/ | |
- name: Deploy to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == env.HOME_REPO | |
shell: bash | |
run: | | |
twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* | |
- name: Create Github release | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == env.HOME_REPO | |
with: | |
artifacts: "dist/*" | |
owner: thebjorn | |
repo: pydeps | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Initial version With help from: | |
# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation) |