Skip to content

Commit

Permalink
chore: some type-hints fixes and actions imps (#19)
Browse files Browse the repository at this point in the history
* chore/fix: some type-hints fixes and actions imps

* chore: add remaining lint steps (deps install and cache them)

* chore: (actions) unignore lockfile for cache imps.
  • Loading branch information
uwinx authored May 4, 2021
1 parent 2f2b1ca commit c6c26a5
Show file tree
Hide file tree
Showing 6 changed files with 884 additions and 19 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: '[CI] test on pull request'

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2

- name: Install python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: |
curl -sSL \
"https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Set up cache
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install
poetry run pip install -U pip
- name: Run lint
run: |
poetry run black --safe --check src/
poetry run isort --check src/
poetry run lint-imports
poetry run flake8 src/
20 changes: 9 additions & 11 deletions .github/workflows/released.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: '[CD] PyPI.org'
name: '[CD] to PyPI'

on:
release:
Expand All @@ -9,29 +9,27 @@ on:
jobs:
deliver_to_pypi:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set Build version
run: |
echo "BUILD_VER=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Install python3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install latest PIP, latest poetry
- name: Install poetry
run: |
python install -m pip install -U pip
pip install -U poetry
- name: Check if version is bumped
- run: |
test $(poetry version -s) = ${{ env.BUILD_VER }}
curl -sSL \
"https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Deliver a new release (first dry run)
run: |
test $(poetry version -s) = ${{ env.BUILD_VER }}
poetry publish -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --dry-run
poetry publish -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,3 @@ ENV/

# ms-vscode
.vscode/

# poetry
poetry.lock
Loading

0 comments on commit c6c26a5

Please sign in to comment.