Skip to content

Commit a0ada87

Browse files
committed
ci: Fix Windows tests
1 parent f559047 commit a0ada87

File tree

1 file changed

+75
-17
lines changed

1 file changed

+75
-17
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,61 @@ on:
1414
jobs:
1515
test:
1616
name: Test
17-
runs-on: ${{ matrix.os }}
1817
strategy:
18+
fail-fast: true
1919
matrix:
20-
os: [ubuntu-latest, macos-latest]
21-
python-version: [3.6, 3.7, 3.8, 3.9]
20+
os: [windows-latest]
21+
python-version: [3.7, 3.8]
22+
defaults:
23+
run:
24+
shell: bash
25+
runs-on: ${{ matrix.os }}
26+
env:
27+
POETRY_VERSION: 1.0.10
2228
steps:
2329
- uses: actions/checkout@v2
2430

2531
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
32+
uses: actions/setup-python@v2
2733
with:
2834
python-version: ${{ matrix.python-version }}
2935

36+
- name: Cache poetry installation
37+
uses: actions/cache@v2
38+
with:
39+
path: |
40+
~/.local/bin/poetry
41+
~/.local/share/pypoetry
42+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
43+
C:\Users\runneradmin\AppData\Roaming\pypoetry\
44+
key:
45+
${{ runner.os }}-poetry-install-${{ matrix.python-version }}-${{
46+
env.POETRY_VERSION }}
47+
3048
- name: Install Poetry
31-
uses: Gr1N/setup-poetry@v4
49+
uses: snok/install-poetry@v1
3250
with:
33-
poetry-version: 1.0.10
51+
version: ${{ env.POETRY_VERSION }}
52+
53+
# - name: Install Poetry
54+
# uses: Gr1N/setup-poetry@v7
55+
# with:
56+
# poetry-version: ${{ env.POETRY_VERSION }}
57+
58+
# - run:
59+
# echo "/c/Users/runneradmin/AppData/Roaming/Python/Scripts" >>
60+
# $GITHUB_PATH
61+
62+
- run:
63+
echo "C:\Users\runneradmin\AppData\Roaming\Python\Scripts" >>
64+
$GITHUB_PATH
65+
66+
- run: |
67+
echo $PATH
68+
ls "C:\Users\runneradmin\AppData\Roaming\Python\Scripts"
69+
echo "cabbage!"
70+
71+
- run: poetry self -V
3472

3573
- name: Get poetry cache directory
3674
id: poetry-cache
@@ -47,41 +85,51 @@ jobs:
4785
${{ runner.os }}-poetry-${{ matrix.python-version }}-
4886
4987
- name: Install dependencies
50-
run: poetry install
88+
run: poetry install --no-interaction --no-root
5189

5290
- name: Test with pytest
5391
run: poetry run make test
5492

5593
format:
5694
name: Check Code Format
95+
env:
96+
POETRY_VERSION: 1.0.10
5797
runs-on: ubuntu-latest
5898
steps:
5999
- uses: actions/checkout@v2
60100

61101
- name: Set up Python 3.7
62-
uses: actions/setup-python@v1
102+
uses: actions/setup-python@v2
63103
with:
64104
python-version: 3.7
65105

106+
- name: Cache poetry installation
107+
uses: actions/cache@v2
108+
with:
109+
path: |
110+
~/.local/
111+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
112+
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}
113+
66114
- name: Install Poetry
67-
uses: Gr1N/setup-poetry@v4
115+
uses: snok/install-poetry@v1
68116
with:
69-
poetry-version: 1.0.10
117+
version: ${{ env.POETRY_VERSION }}
70118

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

75123
- name: Cache poetry dependencies
76-
uses: actions/cache@v1
124+
uses: actions/cache@v2
77125
with:
78126
path: ${{ steps.poetry-cache.outputs.dir }}
79127
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
80128
restore-keys: |
81129
${{ runner.os }}-poetry-3.7-
82130
83131
- name: Install dependencies
84-
run: poetry install
132+
run: poetry install --no-interaction --no-root
85133

86134
- name: Check formatting with black and isort
87135
run: poetry run make check-format
@@ -90,35 +138,45 @@ jobs:
90138
name: Release
91139
if: github.event_name == 'push' && github.ref != 'refs/heads/develop'
92140
needs: [test, format]
141+
env:
142+
POETRY_VERSION: 1.0.10
93143
runs-on: ubuntu-18.04
94144
steps:
95145
- name: Checkout
96146
uses: actions/checkout@v2
97147

98148
- name: Set up Python 3.7
99-
uses: actions/setup-python@v1
149+
uses: actions/setup-python@v2
100150
with:
101151
python-version: 3.7
102152

153+
- name: Cache poetry installation
154+
uses: actions/cache@v2
155+
with:
156+
path: |
157+
~/.local/
158+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
159+
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}
160+
103161
- name: Install Poetry
104-
uses: Gr1N/setup-poetry@v4
162+
uses: snok/install-poetry@v1
105163
with:
106-
poetry-version: 1.0.10
164+
version: ${{ env.POETRY_VERSION }}
107165

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

112170
- name: Cache poetry dependencies
113-
uses: actions/cache@v1
171+
uses: actions/cache@v2
114172
with:
115173
path: ${{ steps.poetry-cache.outputs.dir }}
116174
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
117175
restore-keys: |
118176
${{ runner.os }}-poetry-3.7-
119177
120178
- name: Install dependencies
121-
run: poetry install
179+
run: poetry install --no-interaction --no-root
122180

123181
- name: Create release and publish
124182
id: release

0 commit comments

Comments
 (0)