diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9dd9c26..b8e1f68 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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 }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 34349b7..45d97a4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,15 +10,21 @@ 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 @@ -26,8 +32,9 @@ jobs: 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()