Skip to content

Commit

Permalink
add automation
Browse files Browse the repository at this point in the history
  • Loading branch information
zachary822 committed Sep 2, 2023
1 parent cea1f65 commit fa2b37b
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Upload Python Package

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Run tests
run: |
poetry run pytest
- name: Build package
run: |
poetry build
- uses: actions/upload-artifact@v3
with:
path: ./dist
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: ['build']
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/
29 changes: 29 additions & 0 deletions .github/workflows/run_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package

on:
push:
branches: main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Run tests
run: |
poetry run pytest

0 comments on commit fa2b37b

Please sign in to comment.