Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PyPi workflow #24

Merged
merged 1 commit into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/pypi.yml
@@ -0,0 +1,50 @@
name: PyPI
on:
push:
branches:
- master
- auto-release
pull_request:
branches: [master]
release:
types: [published]

jobs:
build:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Build the sdist
run: |
python setup.py sdist
- name: Check the sdist installs and imports
run: |
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/logical-unification-*.tar.gz
- uses: actions/upload-artifact@v2
with:
name: artifact
path: dist/*

upload_pypi:
name: Upload to PyPI on release
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_secret }}
19 changes: 16 additions & 3 deletions .github/workflows/tests.yml
Expand Up @@ -32,6 +32,7 @@ jobs:
- 'setup.cfg'
- 'requirements.txt'
- '.coveragerc'
- '.pre-commit-config.yaml'

style:
name: Check code style
Expand All @@ -50,7 +51,7 @@ jobs:
- changes
- style
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' }}
if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }}
strategy:
matrix:
python-version:
Expand All @@ -77,8 +78,20 @@ jobs:
parallel: true
flag-name: run-${{ matrix.python-version }}

coveralls_finish:
needs: test
all-checks:
if: ${{ always() }}
runs-on: ubuntu-latest
name: "All tests"
needs: [changes, style, test]
steps:
- name: Check build matrix status
if: ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test.result != 'success') }}
run: exit 1

upload-coverage:
name: "Upload coverage"
needs: [changes, all-checks]
if: ${{ needs.changes.outputs.changes == 'true' && needs.all-checks.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
Expand Down