@@ -16,139 +16,66 @@ jobs:
1616 run : |
1717 pip install pre-commit
1818 pre-commit run --all-files
19- Linux :
19+
20+ Tests :
2021 needs : Linting
21- runs-on : ubuntu-latest
22+ name : ${{ matrix.os }} / ${{ matrix.python-version }}
23+ runs-on : ${{ matrix.os }}-latest
2224 strategy :
2325 matrix :
24- python-version : [2.7, 3.5, 3.6, 3.7, 3.8, pypy3 ]
25-
26+ os : [Ubuntu, MacOS, Windows ]
27+ python-version : [3.6, 3.7, 3.8, pypy3]
2628 steps :
27- - uses : actions/checkout@v2
28- - name : Set up Python ${{ matrix.python-version }}
29- uses : actions/setup-python@v1
30- with :
31- python-version : ${{ matrix.python-version }}
32- - name : Get full python version
33- id : full-python-version
34- run : |
35- echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
36- - name : Install and set up Poetry
37- run : |
38- curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
39- python get-poetry.py --preview -y
40- source $HOME/.poetry/env
41- poetry config virtualenvs.in-project true
42- - name : Set up cache
43- uses : actions/cache@v1
44- with :
45- path : .venv
46- key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
47- - name : Upgrade pip
48- run : |
49- source $HOME/.poetry/env
50- poetry run python -m pip install pip -U
51- - name : Install dependencies
52- run : |
53- source $HOME/.poetry/env
54- poetry install -vvv
55- - name : Test Pure Python
56- run : |
57- source $HOME/.poetry/env
58- PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
59- - name : Test
60- run : |
61- source $HOME/.poetry/env
62- poetry run pytest -q tests
63- poetry install
29+ - uses : actions/checkout@v2
6430
65- MacOS :
66- needs : Linting
67- runs-on : macos-latest
68- strategy :
69- matrix :
70- python-version : [2.7, 3.5, 3.6, 3.7, 3.8, pypy3]
31+ - name : Set up Python ${{ matrix.python-version }}
32+ uses : actions/setup-python@v1
33+ with :
34+ python-version : ${{ matrix.python-version }}
7135
72- steps :
73- - uses : actions/checkout@v2
74- - name : Set up Python ${{ matrix.python-version }}
75- uses : actions/setup-python@v1
76- with :
77- python-version : ${{ matrix.python-version }}
78- - name : Get full python version
79- id : full-python-version
80- run : |
81- echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
82- - name : Install and set up Poetry
83- run : |
84- curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
85- python get-poetry.py --preview -y
86- source $HOME/.poetry/env
87- poetry config virtualenvs.in-project true
88- - name : Set up cache
89- uses : actions/cache@v1
90- with :
91- path : .venv
92- key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-fix-${{ hashFiles('**/poetry.lock') }}
93- - name : Upgrade pip
94- run : |
95- source $HOME/.poetry/env
96- poetry run python -m pip install pip -U
97- - name : Install dependencies
98- run : |
99- source $HOME/.poetry/env
100- poetry install -vvv
101- - name : Test Pure Python
102- run : |
103- source $HOME/.poetry/env
104- PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
105- - name : Test
106- run : |
107- source $HOME/.poetry/env
108- poetry run pytest -q tests
109- Windows :
110- needs : Linting
111- runs-on : windows-latest
112- strategy :
113- matrix :
114- python-version : [2.7, 3.5, 3.6, 3.7, 3.8]
36+ - name : Get full Python version
37+ id : full-python-version
38+ shell : bash
39+ run : echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
11540
116- steps :
117- - uses : actions/checkout@v2
118- - name : Set up Python ${{ matrix.python-version }}
119- uses : actions/setup-python@v1
120- with :
121- python-version : ${{ matrix.python-version }}
122- - name : Get full python version
123- id : full-python-version
124- shell : bash
125- run : |
126- echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
127- - name : Install and setup Poetry
128- run : |
129- Invoke-WebRequest https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -O get-poetry.py
130- python get-poetry.py --preview -y
131- $env:Path += ";$env:Userprofile\.poetry\bin"
132- poetry config virtualenvs.in-project true
133- - name : Set up cache
134- uses : actions/cache@v1
135- with :
136- path : .venv
137- key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
138- - name : Upgrade pip
139- run : |
140- $env:Path += ";$env:Userprofile\.poetry\bin"
141- poetry run python -m pip install pip -U
142- - name : Install dependencies
143- run : |
144- $env:Path += ";$env:Userprofile\.poetry\bin"
145- poetry install -vvv
146- - name : Test Pure Python
147- run : |
148- $env:Path += ";$env:Userprofile\.poetry\bin"
149- $env:PENDULUM_EXTENSIONS = "0"
150- poetry run pytest -q tests
151- - name : Test
152- run : |
153- $env:Path += ";$env:Userprofile\.poetry\bin"
154- poetry run pytest -q tests
41+ - name : Install poetry
42+ shell : bash
43+ run : |
44+ curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
45+ python get-poetry.py --preview -y
46+ echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
47+
48+ - name : Configure poetry
49+ shell : bash
50+ run : poetry config virtualenvs.in-project true
51+
52+ - name : Set up cache
53+ uses : actions/cache@v2
54+ id : cache
55+ with :
56+ path : .venv
57+ key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
58+
59+ - name : Ensure cache is healthy
60+ if : steps.cache.outputs.cache-hit == 'true'
61+ shell : bash
62+ run : poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
63+
64+ - name : Upgrade pip
65+ shell : bash
66+ run : |
67+ poetry run python -m pip install pip -U
68+
69+ - name : Install dependencies
70+ shell : bash
71+ run : poetry install -vvv
72+
73+ - name : Test Pure Python
74+ shell : bash
75+ run : |
76+ PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
77+
78+ - name : Test
79+ shell : bash
80+ run : |
81+ poetry run pytest -q tests
0 commit comments