Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Publish on PyPi / test PyPi and backend lint/format #1

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version-file: './libertai_agents/pyproject.toml'
cache: 'poetry'
- name: Install dependencies
run: poetry install
Expand All @@ -28,7 +28,7 @@ jobs:
target: "./libertai_agents"
execute_command: 'poetry run mypy'

ruff:
package-ruff:
name: "Package: ruff"
runs-on: ubuntu-latest
defaults:
Expand All @@ -40,7 +40,50 @@ jobs:
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version-file: './libertai_agents/pyproject.toml'
cache: 'poetry'
- name: Install dependencies
run: pip install ruff
- name: Run Ruff
run: ruff check --output-format=github

backend-mypy:
name: "Backend: mypy"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version-file: './backend/pyproject.toml'
cache: 'poetry'
- name: Install dependencies
run: poetry install
- uses: tsuyoshicho/action-mypy@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
workdir: './backend'
target: "./src"
execute_command: 'poetry run mypy'

backend-ruff:
name: "Backend: ruff"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version-file: './backend/pyproject.toml'
cache: 'poetry'
- name: Install dependencies
run: pip install ruff
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish release to PyPi

on:
release:
types: [created]

jobs:
pypi-publish:
name: Publish release to PyPI
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./libertai_agents
environment:
name: pypi
url: https://pypi.org/project/libertai-agents
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version-file: './libertai_agents/pyproject.toml'
cache: 'poetry'
- name: Install dependencies
run: poetry install
- name: Build package
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./libertai_agents/dist
Loading