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