🛠 Update poetry installer #42
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '**' | |
pull_request: {} | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
- name: Load cached wheels | |
id: cached-pip-wheels | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/cache | |
poetry.lock | |
key: venv-${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root | |
- name: flake8 | |
run: flake8 parametrize tests | |
test: | |
needs: lint | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.6", "3.7", "3.8", "3.9"] | |
defaults: | |
run: | |
shell: bash # required for windows | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
- name: Load cached wheels | |
id: cached-pip-wheels | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/cache | |
poetry.lock | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root | |
- name: Run mypy | |
run: mypy parametrize | |
- name: Run tests | |
run: pytest tests --cov=parametrize | |
deploy: | |
needs: test | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
- name: Install poetry-dynamic-versioning | |
run: python -m pip install pip install poetry-dynamic-versioning | |
- name: Bump version | |
run: poetry-dynamic-versioning | |
- name: Generate Changelog | |
run: python tools/get_changes.py ${{ github.ref }} > changelog.txt | |
- name: Upload to pypi | |
run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: changelog.txt | |
files: | | |
dist/parametrize-*-.tar.gz | |
dist/parametrize-*-.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |