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

move to gh actions #29

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Next Next commit
move to gh actions
  • Loading branch information
jupe authored Nov 20, 2022
commit d250df1ec69b8abe994f17e33506615a074769e3
56 changes: 56 additions & 0 deletions .github/workflows/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: pytest-stf

on:
push:
branches: [ "master" ]
tags:
- v*
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Build coverage file
run: |
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pytest_lockable test/ | tee pytest-coverage.txt

- name: install release deps
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
pip install wheel twine
python setup.py sdist
python setup.py bdist_wheel
- name: upload to pypi
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
env:
TWINE_USERNAME: "${{secrets.TWINE_USERNAME}}"
TWINE_PASSWORD: "${{secrets.TWINE_PASSWORD}}"
run: |
export PATH=$HOME/.local/bin:$PATH;
twine upload dist/*