From 9938d542259576b5f337f293e7c1c4c0c8916088 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Fri, 12 Jan 2024 15:46:39 +0100 Subject: [PATCH] Add GH workflows --- .github/workflows/full_tests.yml | 27 +++++++++++++++++++++++++ .github/workflows/publish-to-pypi.yml | 29 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/full_tests.yml create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/full_tests.yml b/.github/workflows/full_tests.yml new file mode 100644 index 0000000..ac6f9e7 --- /dev/null +++ b/.github/workflows/full_tests.yml @@ -0,0 +1,27 @@ +name: Test on Ubuntu + +on: + pull_request: + branches: [master] + types: [synchronize, opened, reopened] + + +jobs: + build-and-test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install package + run: | + python -m pip install --upgrade pip + pip install -e . + pip install pytest + - name: Pytest + run: | + pytest -v diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..ceeab25 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,29 @@ +name: Release to PyPI + +on: + push: + tags: + - '*' +jobs: + release: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Tools + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine build + - name: Package and Upload + env: + STACKMANAGER_VERSION: ${{ github.event.release.tag_name }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python -m build --sdist --wheel + twine upload dist/*