Skip to content

Commit

Permalink
ci: Fix Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
btorresgil committed Aug 2, 2021
1 parent f559047 commit a0ada87
Showing 1 changed file with 75 additions and 17 deletions.
92 changes: 75 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,61 @@ 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]
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" >>
$GITHUB_PATH

- run: |
echo $PATH
ls "C:\Users\runneradmin\AppData\Roaming\Python\Scripts"
echo "cabbage!"
- run: poetry self -V

- name: Get poetry cache directory
id: poetry-cache
Expand All @@ -47,41 +85,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 +138,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

0 comments on commit a0ada87

Please sign in to comment.