Skip to content

Adjust GH action to use containers #304

Adjust GH action to use containers

Adjust GH action to use containers #304

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
container:
image: python:${{ matrix.python-version }}-trixie
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true
- name: Initialize environment
run: poetry install
- name: Run black
run: poetry run black temba_client
- name: Run ruff
run: poetry run ruff check temba_client
- name: Run isort
run: poetry run isort temba_client
- name: Run tests
run: poetry run nose2 -C --coverage temba_client --coverage-report term --coverage-report xml
- name: Upload coverage
if: success()
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
release:
name: Release
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: python:3.10-trixie
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Publish release
run: |
python -m pip install -U pip poetry
poetry build
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish