Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 79 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,65 @@ on:
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
os: [windows-latest]
python-version: [3.7, 3.8, 3.9]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
env:
POETRY_VERSION: 1.0.10
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache poetry installation
uses: actions/cache@v2
with:
path: |
~/.local/bin/poetry
~/.local/share/pypoetry
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
C:\Users\runneradmin\AppData\Roaming\pypoetry\
key:
${{ runner.os }}-poetry-install-${{ matrix.python-version }}-${{
env.POETRY_VERSION }}

- name: Install Poetry
uses: Gr1N/setup-poetry@v4
uses: snok/install-poetry@v1
with:
poetry-version: 1.0.10
version: ${{ env.POETRY_VERSION }}

# - name: Install Poetry
# uses: Gr1N/setup-poetry@v7
# with:
# poetry-version: ${{ env.POETRY_VERSION }}

# - run:
# echo "/c/Users/runneradmin/AppData/Roaming/Python/Scripts" >>
# $GITHUB_PATH

# - run:
# echo "C:\Users\runneradmin\AppData\Roaming\Python\Scripts\bin" >>
# $GITHUB_PATH

- run: |
echo $PATH
echo "----"
ls "C:\Users\runneradmin\AppData\Roaming\Python\Scripts"
echo "----"
ls "C:\Users\runneradmin\AppData\Roaming\Python\Scripts/bin"
echo "----"
echo "cabbage!"

- run: poetry self -V

- name: Get poetry cache directory
id: poetry-cache
Expand All @@ -47,41 +89,51 @@ jobs:
${{ runner.os }}-poetry-${{ matrix.python-version }}-

- name: Install dependencies
run: poetry install
run: poetry install --no-interaction --no-root

- name: Test with pytest
run: poetry run make test

format:
name: Check Code Format
env:
POETRY_VERSION: 1.0.10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Cache poetry installation
uses: actions/cache@v2
with:
path: |
~/.local/
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}

- name: Install Poetry
uses: Gr1N/setup-poetry@v4
uses: snok/install-poetry@v1
with:
poetry-version: 1.0.10
version: ${{ env.POETRY_VERSION }}

- name: Get poetry cache directory
id: poetry-cache
run: echo "::set-output name=dir::$(poetry config cache-dir)"

- name: Cache poetry dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.poetry-cache.outputs.dir }}
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-3.7-

- name: Install dependencies
run: poetry install
run: poetry install --no-interaction --no-root

- name: Check formatting with black and isort
run: poetry run make check-format
Expand All @@ -90,35 +142,45 @@ jobs:
name: Release
if: github.event_name == 'push' && github.ref != 'refs/heads/develop'
needs: [test, format]
env:
POETRY_VERSION: 1.0.10
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Cache poetry installation
uses: actions/cache@v2
with:
path: |
~/.local/
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}

- name: Install Poetry
uses: Gr1N/setup-poetry@v4
uses: snok/install-poetry@v1
with:
poetry-version: 1.0.10
version: ${{ env.POETRY_VERSION }}

- name: Get poetry cache directory
id: poetry-cache
run: echo "::set-output name=dir::$(poetry config cache-dir)"

- name: Cache poetry dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.poetry-cache.outputs.dir }}
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-3.7-

- name: Install dependencies
run: poetry install
run: poetry install --no-interaction --no-root

- name: Create release and publish
id: release
Expand Down