Automatically format generated Python code. #55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Deploy | |
on: | |
push: | |
pull_request: | |
release: | |
types: | |
- created | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
# https://endoflife.date/python | |
platform: [ | |
{ os: 'ubuntu-latest', python-version: '3.9' }, | |
{ os: 'ubuntu-latest', python-version: '3.10' }, | |
{ os: 'ubuntu-latest', python-version: '3.11' }, | |
{ os: 'ubuntu-latest', python-version: '3.12' }, | |
{ os: 'ubuntu-latest', python-version: '3.13' }, | |
{ os: 'macos-latest', python-version: '3.9' }, | |
{ os: 'macos-latest', python-version: '3.10' }, | |
{ os: 'macos-latest', python-version: '3.11' }, | |
{ os: 'macos-latest', python-version: '3.12' }, | |
{ os: 'macos-latest', python-version: '3.13' }, | |
{ os: 'windows-latest', python-version: '3.9' }, | |
{ os: 'windows-latest', python-version: '3.10' }, | |
{ os: 'windows-latest', python-version: '3.11' }, | |
{ os: 'windows-latest', python-version: '3.12' }, | |
{ os: 'windows-latest', python-version: '3.13' }, | |
] | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Run tests | |
run: uv run pytest tests | |
- name: Install self | |
run: uv pip install -e . | |
- name: Generate bindings | |
run: uv run stellar-contract-bindings python --contract-id CDOAW6D7NXAPOCO7TFAWZNJHK62E3IYRGNRVX3VOXNKNVOXCLLPJXQCF --rpc-url https://mainnet.sorobanrpc.com --output ./bindings | |
deploy: | |
needs: [ test ] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'created' | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up Python 3.13 | |
run: uv python install 3.13 | |
- name: Build the project | |
run: uv build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
complete: | |
if: always() | |
needs: [ test, deploy ] | |
runs-on: ubuntu-latest | |
steps: | |
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
run: exit 1 |