Skip to content

relaxed to use python 3.8 (#74) #41

relaxed to use python 3.8 (#74)

relaxed to use python 3.8 (#74) #41

Workflow file for this run

name: Publish to Test PyPI
on:
push:
branches: [ main ]
jobs:
test_and_build:
# The type of runner that the job will run on
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", 3.11]
poetry-version: [1.8]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Set up cache
uses: actions/cache@v1
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'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install dependencies
run: |
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --max-line-length=127 --show-source --statistics
- name: Run tests
run: |
poetry run pytest
- name: Build
run: poetry build -f wheel
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: |
dist
gather_n_publish:
runs-on: ubuntu-latest
needs: test_and_build
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up Poetry 1.8
uses: abatilo/[email protected]
with:
poetry-version: 1.8
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist/
- name: Bump version
run: poetry version patch
- name: Install dependencies
run: |
poetry install
- name: Build sdist
run: poetry build -f sdist
- name: Display structure of downloaded files
run: ls -R
working-directory: ./
- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
- name: Publish package
run: poetry publish --no-interaction --dry-run -r testpypi -vvv
build_docs:
name: Build and deploy docs
runs-on: ubuntu-latest
needs: test_and_build
steps:
- name: Checkout main
uses: actions/checkout@v2
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: .config/mkdocs/mkdocs.yml
REQUIREMENTS: .config/mkdocs/requirements.txt
# EXTRA_PACKAGES: build-base