Skip to content

Commit

Permalink
Make GitHub Actions more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
reneleonhardt committed Sep 1, 2024
1 parent 534c552 commit 87cd349
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ jobs:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v5
- name: checkout
uses: actions/checkout@v4
- name: install poetry
run: pipx install poetry
- name: setup latest python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: poetry
- run: |
- name: build new version ${{ env.GITHUB_REF_NAME }}
run: |
poetry version ${GITHUB_REF_NAME#v}
poetry build
- uses: pypa/gh-action-pypi-publish@release/v1
- run: gh release upload $GITHUB_REF_NAME dist/*
- name: upload new release ${{ env.GITHUB_REF_NAME }}
run: gh release upload $GITHUB_REF_NAME dist/*
env:
GH_TOKEN: ${{ github.token }}
23 changes: 15 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,31 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v5
- name: checkout
uses: actions/checkout@v4
- name: install poetry
run: pipx install poetry
- name: setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: poetry install --with=dev
- run: poetry run ruff check --output-format=github .
- run: poetry run ruff format --check .
- name: install (dev) dependencies
run: poetry install --with=dev
- name: lint code
run: poetry run ruff check --output-format=github .
- name: check formatting
run: poetry run ruff format --check .
- run: poetry run pytest . --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=ollama --cov-report=xml --cov-report=html
- name: check poetry.lock is up-to-date
run: poetry check --lock
- name: check requirements.txt is up-to-date
run: |
poetry export >requirements.txt
git diff --exit-code requirements.txt
- uses: actions/upload-artifact@v4
- name: upload test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}
if: always()

0 comments on commit 87cd349

Please sign in to comment.