Python tests
This commit is contained in:
parent
e113cdf54d
commit
c489457f36
|
@ -3,9 +3,6 @@ name: Python Package
|
|||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
PUBLISH:
|
||||
required: false
|
||||
type: boolean
|
||||
secrets:
|
||||
PIPY_REPO_USER:
|
||||
required: true
|
||||
|
@ -15,7 +12,7 @@ on:
|
|||
type: string
|
||||
|
||||
jobs:
|
||||
test-and-publish:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:21-bookworm
|
||||
|
@ -30,19 +27,10 @@ jobs:
|
|||
- name: Installing Python Dependencies
|
||||
if: success()
|
||||
run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest --break-system-packages
|
||||
- name: Installing Python Test Dependencies
|
||||
if: success() && hashFiles('requirements_test.txt') != ''
|
||||
run: python3 -m pip install --upgrade -r requirements_test.txt --break-system-packages
|
||||
- name: Installing package
|
||||
if: success()
|
||||
run: python3 -m pip install .[test] --break-system-packages
|
||||
- name: Test Python Code
|
||||
if: success()
|
||||
run: python3 -m pytest test
|
||||
- name: Build
|
||||
if: success() && inputs.PUBLISH
|
||||
if: success()
|
||||
run: python3 -m build
|
||||
- name: Publish
|
||||
if: success() && inputs.PUBLISH
|
||||
if: success()
|
||||
run: python3 -m twine upload --repository-url "https://gitfub.space/api/packages/${{ secrets.PIPY_REPO_USER }}/pypi" -u ${{ secrets.PIPY_REPO_USER }} -p ${{ secrets.PIPY_REPO_PASS }} dist/*
|
||||
|
||||
|
|
32
.gitea/workflows/python-test.yaml
Normal file
32
.gitea/workflows/python-test.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Python Test
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
secrets:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:21-bookworm
|
||||
steps:
|
||||
- name: Setting up Python ${{ env.PYTHON_VERSION }} for ${{runner.arch}} ${{runner.os}}
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y python3 python3-pip
|
||||
- name: Check out repository code
|
||||
if: success()
|
||||
uses: actions/checkout@v3
|
||||
- name: Installing Python Dependencies
|
||||
if: success()
|
||||
run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest --break-system-packages
|
||||
- name: Installing Python Test Dependencies
|
||||
if: success() && hashFiles('requirements_test.txt') != ''
|
||||
run: python3 -m pip install --upgrade -r requirements_test.txt --break-system-packages
|
||||
- name: Installing package
|
||||
if: success()
|
||||
run: python3 -m pip install .[test] --break-system-packages
|
||||
- name: Test Python Code
|
||||
if: success()
|
||||
run: python3 -m pytest test
|
Loading…
Reference in New Issue
Block a user