mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-08-23 07:10:05 +02:00
Using the python action and the inbuild poetry cache (#261)
I have found out that the python setup action supports the use of the poetry cache which increases the build speed.
This commit is contained in:
30
.github/workflows/lint-actions.yaml
vendored
30
.github/workflows/lint-actions.yaml
vendored
@@ -18,23 +18,19 @@ jobs:
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.6.1
|
||||
virtualenvs-create: false
|
||||
virtualenvs-path: ~/local/share/virtualenvs
|
||||
cache: poetry
|
||||
- run: poetry install --without develop,doc --all-extras
|
||||
- name: Run mypy
|
||||
run: |
|
||||
mypy src tests
|
||||
poetry run mypy src tests
|
||||
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -48,22 +44,16 @@ jobs:
|
||||
name: Check Python Requirements
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.6.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-path: ~/local/share/virtualenvs
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Install root, pip-licenses & pip-audit
|
||||
run: |
|
||||
poetry run pip install pip-licenses pip-audit
|
||||
cache: poetry
|
||||
- run: poetry install --without develop,doc --all-extras
|
||||
- name: Poetry export
|
||||
run: poetry export -f requirements.txt --output requirements.txt
|
||||
- name: Check license
|
||||
|
10
.github/workflows/maintenance.yaml
vendored
10
.github/workflows/maintenance.yaml
vendored
@@ -20,10 +20,13 @@ jobs:
|
||||
package_name: ${{ github.event.repository.name }}/${{ matrix.name }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
auto-update:
|
||||
pre-commit-autoupdate:
|
||||
name: pre-commit autoupdate
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
|
||||
@@ -35,7 +38,12 @@ jobs:
|
||||
- uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
base: main
|
||||
branch: update/pre-commit-hooks
|
||||
title: Update pre-commit hooks
|
||||
commit-message: 'chore: update pre-commit hooks'
|
||||
body: Update versions of pre-commit hooks to latest version.
|
||||
labels: chore
|
||||
assignees: philipp-horstenkamp
|
||||
reviewers: philipp-horstenkamp
|
||||
delete-branch: true
|
||||
|
71
.github/workflows/test-and-build-action.yaml
vendored
71
.github/workflows/test-and-build-action.yaml
vendored
@@ -15,25 +15,15 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Python
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.11
|
||||
- name: Install APT
|
||||
run: |
|
||||
sudo apt update
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.6.1
|
||||
virtualenvs-path: ~/local/share/virtualenvs
|
||||
- id: cache-pipenv
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.local/share/virtualenvs
|
||||
key: venv
|
||||
python-version: '3.11'
|
||||
cache: poetry
|
||||
- run: poetry install --without develop,doc,lint --all-extras
|
||||
- name: Run test suite
|
||||
run: |
|
||||
@@ -45,7 +35,7 @@ jobs:
|
||||
path: |
|
||||
coverage.xml
|
||||
.coverage
|
||||
- name: Archive code coverage results
|
||||
- name: Archive unit test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-report
|
||||
@@ -77,24 +67,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Python
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.11
|
||||
- id: cache-pipenv
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.local/share/virtualenvs
|
||||
key: venv
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.6.1
|
||||
virtualenvs-path: ~/local/share/virtualenvs
|
||||
- run: |
|
||||
poetry install --only test --all-extras
|
||||
python-version: '3.11'
|
||||
cache: poetry
|
||||
- run: poetry install --only test --all-extras
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: code-coverage-report
|
||||
@@ -113,22 +95,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- name: Setup Python
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.11
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.6.1
|
||||
virtualenvs-path: ~/local/share/virtualenvs
|
||||
- id: cache-pipenv
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.local/share/virtualenvs
|
||||
key: venv
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
python-version: '3.11'
|
||||
cache: poetry
|
||||
- run: |
|
||||
poetry build
|
||||
- name: Archive builds
|
||||
|
Reference in New Issue
Block a user