Skip to content

Commit

Permalink
Merge pull request #4 from marcelotrevisani/add-github-workflows
Browse files Browse the repository at this point in the history
Add github workflows
  • Loading branch information
marcelotrevisani authored Jul 11, 2023
2 parents d7ff45e + 1344ce9 commit 3e3c5aa
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/release_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Package to PyPI

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine check --strict dist/*
twine upload dist/*
53 changes: 53 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tests

on:
push:
branches:
- master
pull_request:
branches:
- "*"

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
py_ver: ["3.10", "3.11"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.py_ver }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_ver }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[testing]
- name: Running tests
shell: bash -l {0}
run: |
pytest tests \
-vv \
-n auto \
--color=yes \
--cov=./ \
--cov-append \
--cov-report html:coverage-serial-html \
--cov-report xml:coverage-serial.xml \
--cov-config=.coveragerc \
--junit-xml=${{ matrix.os }}-py${{ matrix.py_ver }}.xml \
--junit-prefix=${{ matrix.os }}-py${{ matrix.py_ver }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage-serial.xml,./coverage-parallel.xml
directory: .
flags: unittests
name: orko-tests
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ orko = "orko.cli:orko_cli"
[project.optional-dependencies]
testing = [
"pytest",
"pytest-xdist",
"pytest-xdist[psutil]",
"pytest-cov",
"pip",
]
Expand Down

0 comments on commit 3e3c5aa

Please sign in to comment.