spotframework/.gitea/workflows/ci.yml

67 lines
1.8 KiB
YAML
Raw Normal View History

2024-07-20 13:41:23 +01:00
name: Tests
on: [push, pull_request]
2024-07-28 14:05:54 +01:00
env:
python-version: '3.10'
poetry-version: 1.8.3
2024-07-20 13:41:23 +01:00
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4 # get source
with:
github-server-url: https://gitea.sheep-ghoul.ts.net
- name: Install Python 3
uses: actions/setup-python@v4
with:
2024-07-28 14:05:54 +01:00
python-version: ${{ env.python-version }}
2024-07-20 13:41:23 +01:00
- name: Install Poetry # dependency management
uses: abatilo/actions-poetry@v2.1.6
with:
2024-07-28 14:05:54 +01:00
poetry-version: ${{ env.poetry-version }}
2024-07-20 13:41:23 +01:00
- name: Install Dependencies
run: poetry install
- name: Run Tests # test script
2024-07-28 14:02:12 +01:00
run: poetry run python -m unittest discover -s tests
publishLib:
runs-on: ubuntu-latest
name: Package Library
needs: [ build ] # for ignoring bad builds
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
github-server-url: https://gitea.sheep-ghoul.ts.net
- name: Install Python 3
uses: actions/setup-python@v4
with:
2024-07-28 14:05:54 +01:00
python-version: ${{ env.python-version }}
2024-07-28 14:02:12 +01:00
- name: Install Poetry # dependency management
uses: abatilo/actions-poetry@v2.1.6
with:
2024-07-28 14:05:54 +01:00
poetry-version: ${{ env.poetry-version }}
2024-07-28 14:02:12 +01:00
2024-07-28 14:16:17 +01:00
- name: Poetry Add Repo
run: poetry source add --priority=supplemental sargit https://git.sarsoo.xyz/api/packages/${{ secrets.PYPI_USERNAME }}/pypi
- name: Poetry Repo Creds
run: poetry config http-basic.sargit ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_KEY }}
2024-07-28 14:02:12 +01:00
- name: Poetry Build
run: poetry build
- name: Poetry Publish
2024-07-28 14:11:05 +01:00
run: poetry publish --repository sargit