mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-07-14 06:34:04 +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:
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