Skip to content

Commit 1e196e1

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

File tree

1 file changed

+69
-18
lines changed

1 file changed

+69
-18
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,54 @@ 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

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

3566
- name: Get poetry cache directory
3667
id: poetry-cache
@@ -47,41 +78,51 @@ jobs:
4778
${{ runner.os }}-poetry-${{ matrix.python-version }}-
4879
4980
- name: Install dependencies
50-
run: poetry install
81+
run: poetry install --no-interaction --no-root
5182

5283
- name: Test with pytest
5384
run: poetry run make test
5485

5586
format:
5687
name: Check Code Format
88+
env:
89+
POETRY_VERSION: 1.0.10
5790
runs-on: ubuntu-latest
5891
steps:
5992
- uses: actions/checkout@v2
6093

6194
- name: Set up Python 3.7
62-
uses: actions/setup-python@v1
95+
uses: actions/setup-python@v2
6396
with:
6497
python-version: 3.7
6598

99+
- name: Cache poetry installation
100+
uses: actions/cache@v2
101+
with:
102+
path: |
103+
~/.local/
104+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
105+
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}
106+
66107
- name: Install Poetry
67-
uses: Gr1N/setup-poetry@v4
108+
uses: snok/install-poetry@v1
68109
with:
69-
poetry-version: 1.0.10
110+
version: ${{ env.POETRY_VERSION }}
70111

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

75116
- name: Cache poetry dependencies
76-
uses: actions/cache@v1
117+
uses: actions/cache@v2
77118
with:
78119
path: ${{ steps.poetry-cache.outputs.dir }}
79120
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
80121
restore-keys: |
81122
${{ runner.os }}-poetry-3.7-
82123
83124
- name: Install dependencies
84-
run: poetry install
125+
run: poetry install --no-interaction --no-root
85126

86127
- name: Check formatting with black and isort
87128
run: poetry run make check-format
@@ -90,35 +131,45 @@ jobs:
90131
name: Release
91132
if: github.event_name == 'push' && github.ref != 'refs/heads/develop'
92133
needs: [test, format]
134+
env:
135+
POETRY_VERSION: 1.0.10
93136
runs-on: ubuntu-18.04
94137
steps:
95138
- name: Checkout
96139
uses: actions/checkout@v2
97140

98141
- name: Set up Python 3.7
99-
uses: actions/setup-python@v1
142+
uses: actions/setup-python@v2
100143
with:
101144
python-version: 3.7
102145

146+
- name: Cache poetry installation
147+
uses: actions/cache@v2
148+
with:
149+
path: |
150+
~/.local/
151+
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\
152+
key: ${{ runner.os }}-poetry-install-${{ env.POETRY_VERSION }}
153+
103154
- name: Install Poetry
104-
uses: Gr1N/setup-poetry@v4
155+
uses: snok/install-poetry@v1
105156
with:
106-
poetry-version: 1.0.10
157+
version: ${{ env.POETRY_VERSION }}
107158

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

112163
- name: Cache poetry dependencies
113-
uses: actions/cache@v1
164+
uses: actions/cache@v2
114165
with:
115166
path: ${{ steps.poetry-cache.outputs.dir }}
116167
key: ${{ runner.os }}-poetry-3.7-${{ hashFiles('**/poetry.lock') }}
117168
restore-keys: |
118169
${{ runner.os }}-poetry-3.7-
119170
120171
- name: Install dependencies
121-
run: poetry install
172+
run: poetry install --no-interaction --no-root
122173

123174
- name: Create release and publish
124175
id: release

0 commit comments

Comments
 (0)