Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/piotrmaslanka/satella in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
piotrmaslanka committed Mar 6, 2024
2 parents 1aba693 + 34af6f6 commit 8e3e390
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
61 changes: 40 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@ name: build-satella
run-name: ${{ github.actor }}
on: [ push ]
jobs:
modify-version:
runs-on: "ubuntu-latest"
steps:
- name: Alter Version
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: |
echo -e '__version__ = "' > satella/__init__.py
echo -e '${{ github.event.release.tag_name }}' >> satella/__init__.py
echo '"' >> satella/__init__.py
- name: View version
run: |
echo -e "Doing version v"
python -c "import satella; print(satella.__version__)"
prepare-system:
needs: ["modify-version"]
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [ "3.9" ]
steps:
- uses: actions/checkout@4
- uses: actions/setup-python@4
with:
python-version: '$${{ matrix.version }}'
- name: Install everything
run: pip install -e .[test,dev,extras]
with:
python-version: '${{ matrix.python-version }}'
cache: 'pip'
paths: ["dist/*"]
tests:
runs-on: ubuntu-latest
needs: ["modify-version"]
strategy:
matrix:
python-version: [ "3.6", "3.7", "3.8", "pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12" ]
Expand All @@ -29,21 +39,30 @@ jobs:
cache: 'pip'
- name: Test everything
run: pytest -n 8 -vv --cov=satella
with:
python-version: '${{ matrix.python-version }}'
cache: 'pip'
build-package:
needs: ["prepare-system"]
runs-on: ubuntu-latest
upload-coverage:
runs-on: "ubuntu-latest"
needs: ["tests"]
steps:
- name: Build package
- run: coverage xml
- uses: caffco/[email protected]
build-project:
runs-on: "ubuntu-latest"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
matrix:
python-version: [ "3.6", "3.7", "3.8", "pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: Build
run: python -m build .
- name: Store credentials
send-to-pypi:
runs-on: "ubuntu-latest"
needs: ["build-project", "tests"]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Install Twine
run: pip install twine
- name: Send over packages to PyPI
run: |
echo $PYPIRC_PASSWORD_DATA > ~/.pypirc
echo PYPIRC_PASSWORD_DATA > ~/.pypirc
twine upload dist/*
convert-and-upload-coverage:
needs: ["build-package", "tests"]
steps:
- run: coverage xml
- uses: caffco/[email protected]
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ pip install satella[extras]
Running unit tests
------------------

Tests run by default on CircleCI.
Tests run by default on GitHub Actions.

They should pass on Windows too, but some tests requiring POSIX-like functionality are skipped.

Automatic release system
------------------------

Releases happen automatically. Just add a tag with

0 comments on commit 8e3e390

Please sign in to comment.