From e6a1922a2445f8b44be459daabf7a70080253ffa Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 19 May 2024 14:18:39 -0500 Subject: [PATCH] add python CI --- .github/workflows/python-build.yml | 33 ++++++++++++++++++++++++++++ .github/workflows/python-publish.yml | 31 ++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/python-build.yml create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml new file mode 100644 index 0000000..7a89493 --- /dev/null +++ b/.github/workflows/python-build.yml @@ -0,0 +1,33 @@ +name: Run Python Build + +on: + push: + branches: [main] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + env: + OPENAI_API_KEY: "none" + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dev dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements/dev.txt -r requirements/base.txt + - name: Check style + run: make lint-check + - name: Run tests + run: make test + # name: Upload coverage reports to Codecov + # uses: codecov/codecov-action@v4.0.1 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} + # slug: ssube/taleweaveai \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..c26dbb9 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}