Skip to content

Commit

Permalink
- adding workflows;
Browse files Browse the repository at this point in the history
  • Loading branch information
jaltmayerpizzorno committed May 15, 2024
1 parent 7c82549 commit 9b8d4f4
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-and-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# When executed manually, this will upload to testpypi;
# when executed upon a release, it will upload to pypi.
#
# For pypi, you need to have the PYPI_USERNAME and PYPI_PASSWORD secrets configured.
# For testpypi, you'll need TESTPYPI_USERNAME and TESTPYPI_PASSWORD.
#
name: build & upload

on:
release:
types: [ published ]
workflow_dispatch:

jobs:
build-wheel:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.11

- name: build it
run: |
python3 -m pip install build twine
python3 -m build
- name: Non-release (dev) upload
if: github.event_name != 'release'
env:
TWINE_REPOSITORY: testpypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
run: twine upload --verbose dist/*

- name: Release upload
if: github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload --verbose dist/*
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: tests

on:
push:
paths:
- src/**
- test/**

pull_request:

workflow_dispatch:

jobs:
run-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-13 ]
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true

- name: install dependencies
run: |
python3 -m pip install .
- name: run tests
run: |
python3 -m pytest

0 comments on commit 9b8d4f4

Please sign in to comment.