Skip to content

Commit

Permalink
Change: Update CI workflows
Browse files Browse the repository at this point in the history
* Use newest poetry version
* Cache poetry installation
* Use poetry to upload releases on pypi
  • Loading branch information
bjoernricks committed Apr 14, 2023
1 parent a10fabd commit 500d1f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
pull_request:
branches: [main]

env:
POETRY_VERSION: "1.4.0"

jobs:
linting:
name: Linting
Expand All @@ -26,7 +23,6 @@ jobs:
with:
packages: pontos tests scripts
version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache: "true"

test:
Expand All @@ -44,8 +40,8 @@ jobs:
uses: greenbone/actions/poetry@v2
with:
version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache: "true"
cache-poetry-installation: "true"
- name: Run unit tests
run: poetry run python -m unittest

Expand All @@ -59,7 +55,6 @@ jobs:
uses: greenbone/actions/coverage-python@v2
with:
version: "3.10"
poetry-version: ${{ env.POETRY_VERSION }}
cache: "true"
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -71,8 +66,8 @@ jobs:
- name: Install python, poetry and dependencies
uses: greenbone/actions/poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
cache: "true"
cache-poetry-installation: "true"
- name: Check version
run: |
poetry run pontos-version verify current
16 changes: 6 additions & 10 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
uses: greenbone/actions/poetry@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
python -m pip install --upgrade twine
version: "3.10"
install-dependencies: "false"
cache-poetry-installation: "true"
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
poetry build
twine upload dist/*
poetry upload
2 changes: 1 addition & 1 deletion .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
uses: greenbone/actions/poetry@v2
with:
version: "3.10"
poetry-version: "1.4.0"
cache: "true"
cache-poetry-installation: "true"
- name: Build Documentation
run: |
cd docs && poetry run make html
Expand Down

0 comments on commit 500d1f1

Please sign in to comment.