Skip to content

Commit 00192ab

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

File tree

1 file changed

+79
-17
lines changed

1 file changed

+79
-17
lines changed

.github/workflows/ci.yml

Lines changed: 79 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,65 @@ 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, 3.9]
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\bin" >>
64+
# $GITHUB_PATH
65+
66+
- run: |
67+
echo $PATH
68+
echo "----"
69+
ls "C:\Users\runneradmin\AppData\Roaming\Python\Scripts"
70+
echo "----"
71+
ls "C:\Users\runneradmin\AppData\Roaming\Python\Scripts/bin"
72+
echo "----"
73+
echo "cabbage!"
74+
75+
- run: poetry self -V
3476

3577
- name: Get poetry cache directory
3678
id: poetry-cache
@@ -47,41 +89,51 @@ jobs:
4789
${{ runner.os }}-poetry-${{ matrix.python-version }}-
4890
4991
- name: Install dependencies
50-
run: poetry install
92+
run: poetry install --no-interaction --no-root
5193

5294
- name: Test with pytest
5395
run: poetry run make test
5496

5597
format:
5698
name: Check Code Format
99+
env:
100+
POETRY_VERSION: 1.0.10
57101
runs-on: ubuntu-latest
58102
steps:
59103
- uses: actions/checkout@v2
60104

61105
- name: Set up Python 3.7
62-
uses: actions/setup-python@v1
106+
uses: actions/setup-python@v2
63107
with:
64108
python-version: 3.7
65109

110+
- name: Cache poetry installation
111+
uses: actions/cache@v2
112+
with:
113+
path: |
114+
~/.local/
115+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
116+
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}
117+
66118
- name: Install Poetry
67-
uses: Gr1N/setup-poetry@v4
119+
uses: snok/install-poetry@v1
68120
with:
69-
poetry-version: 1.0.10
121+
version: ${{ env.POETRY_VERSION }}
70122

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

75127
- name: Cache poetry dependencies
76-
uses: actions/cache@v1
128+
uses: actions/cache@v2
77129
with:
78130
path: ${{ steps.poetry-cache.outputs.dir }}
79131
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
80132
restore-keys: |
81133
${{ runner.os }}-poetry-3.7-
82134
83135
- name: Install dependencies
84-
run: poetry install
136+
run: poetry install --no-interaction --no-root
85137

86138
- name: Check formatting with black and isort
87139
run: poetry run make check-format
@@ -90,35 +142,45 @@ jobs:
90142
name: Release
91143
if: github.event_name == 'push' && github.ref != 'refs/heads/develop'
92144
needs: [test, format]
145+
env:
146+
POETRY_VERSION: 1.0.10
93147
runs-on: ubuntu-18.04
94148
steps:
95149
- name: Checkout
96150
uses: actions/checkout@v2
97151

98152
- name: Set up Python 3.7
99-
uses: actions/setup-python@v1
153+
uses: actions/setup-python@v2
100154
with:
101155
python-version: 3.7
102156

157+
- name: Cache poetry installation
158+
uses: actions/cache@v2
159+
with:
160+
path: |
161+
~/.local/
162+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
163+
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}
164+
103165
- name: Install Poetry
104-
uses: Gr1N/setup-poetry@v4
166+
uses: snok/install-poetry@v1
105167
with:
106-
poetry-version: 1.0.10
168+
version: ${{ env.POETRY_VERSION }}
107169

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

112174
- name: Cache poetry dependencies
113-
uses: actions/cache@v1
175+
uses: actions/cache@v2
114176
with:
115177
path: ${{ steps.poetry-cache.outputs.dir }}
116178
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
117179
restore-keys: |
118180
${{ runner.os }}-poetry-3.7-
119181
120182
- name: Install dependencies
121-
run: poetry install
183+
run: poetry install --no-interaction --no-root
122184

123185
- name: Create release and publish
124186
id: release

0 commit comments

Comments
 (0)