-
Notifications
You must be signed in to change notification settings - Fork 981
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various improvements in tests/CI (#1271)
* Run unit tests with all supported Python versions. * Caching of Python deps in CI. Special care taken of python-poetry/poetry#2117 * Local action for DRY Python/Poetry install with caching.
- Loading branch information
Showing
4 changed files
with
77 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'Install Python, poetry and dependencies.' | ||
description: 'Install Python, Poetry and poetry dependencies using cache' | ||
|
||
inputs: | ||
python-version: | ||
description: 'Python version' | ||
required: true | ||
poetry-version: | ||
description: 'Poetry version' | ||
required: true | ||
poetry-working-directory: | ||
description: 'Working directory for poetry command.' | ||
required: false | ||
default: '.' | ||
poetry-install-args: | ||
description: 'Extra arguments for poetry install, e.g. --with tests.' | ||
required: false | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Cache poetry install | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ runner.os }}-${{ inputs.poetry-version }}-0 | ||
- name: Install Poetry | ||
run: pipx install 'poetry==${{ inputs.poetry-version }}' | ||
shell: bash | ||
- name: Set up Python ${{ inputs.python-version }} | ||
id: setup_python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: poetry | ||
cache-dependency-path: ${{ inputs.poetry-working-directory }}/poetry.lock | ||
- name: Set Poetry environment | ||
run: poetry -C '${{ inputs.poetry-working-directory }}' env use '${{ steps.setup_python.outputs.python-path }}' | ||
shell: bash | ||
- name: Install Python dependencies | ||
run: poetry -C '${{ inputs.poetry-working-directory }}' install ${{ inputs.poetry-install-args }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters