ci: verify pip conf script in multi python versions #4
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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
name: ci | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
permissions: | ||
contents: read | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
- name: Load cached Poetry installation | ||
id: cached-poetry | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local # the path depends on the OS | ||
key: poetry-0 # increment to reset cache | ||
- name: Install Poetry | ||
if: steps.cached-poetry.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
- name: Configure poetry | ||
if: steps.cached-poetry.outputs.cache-hit == 'true' | ||
run: poetry config virtualenvs.in-project true | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
env: | ||
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 | ||
#---------------------------------------------- | ||
# install your root project, if package-mode is true | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
- name: Check code style and Type Hint | ||
run: poetry run fast check | ||
- name: Verify pip conf script | ||
run: ./pip_conf.py | ||
ConfPip: | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
- name: Verify pip conf script | ||
run: python pip_conf.py |