commit file #148
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 workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python application | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- "README.md" | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- "README.md" | |
jobs: | |
tests: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }}-latest | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
os: [Ubuntu] | |
python-version: [3.11.4] | |
experimental: [false] | |
bootstrap-args: [""] | |
include: | |
- os: Ubuntu | |
python-version: "3.11.4" | |
experimental: true | |
bootstrap-args: "--git https://github.com/python-poetry/poetry.git" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get full Python version | |
id: full-python-version | |
shell: bash | |
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | |
- name: Bootstrap poetry | |
shell: bash | |
run: | | |
curl -sSL https://install.python-poetry.org \ | |
| python - -y ${{ matrix.bootstrap-args }} | |
- name: Update PATH | |
if: ${{ matrix.os != 'Windows' }} | |
shell: bash | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Update Path for Windows | |
if: ${{ matrix.os == 'Windows' }} | |
shell: bash | |
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH | |
- name: Configure poetry | |
shell: bash | |
run: poetry config virtualenvs.in-project true | |
- name: Set up cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Ensure cache is healthy | |
if: steps.cache.outputs.cache-hit == 'true' | |
shell: bash | |
run: timeout 10s poetry run pip --version || rm -rf .venv | |
- name: Install dependencies | |
shell: bash | |
run: poetry install | |
- name: Run pytest | |
shell: bash | |
run: poetry run python -m pytest -p no:sugar -q tests/ | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 |