Skip to content

Merge pull request #6 from bleu-fi/jose/cowpy-3-generate-contract-cod… #24

Merge pull request #6 from bleu-fi/jose/cowpy-3-generate-contract-cod…

Merge pull request #6 from bleu-fi/jose/cowpy-3-generate-contract-cod… #24

Workflow file for this run

---
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: main
release:
types: [released]
jobs:
ci:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [
"3.8", "3.9", "3.10", "3.11", "3.12",
]
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Typecheck
run: |
poetry run pyright .
- name: Lint
run: |
poetry run ruff check .
- name: Test
run: |
poetry run pytest tests/
- name: Build sdist
run: |
poetry build -f sdist
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: |
dist
- name: Display structure of downloaded files
run: |
ls -R
working-directory: ./
- run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: |
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
- name: Publish package (test)
run: |
poetry publish --no-interaction --dry-run -r testpypi -vvv
- if: github.event_name == 'release'
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Publish package (prod)
if: github.event_name == 'release'
run: |
poetry publish --no-interaction -vvv