@@ -10,14 +10,6 @@ concurrency:
1010 cancel-in-progress : true
1111
1212jobs :
13- lint :
14- runs-on : ubuntu-latest
15- steps :
16- - uses : actions/checkout@v3
17- - uses : actions/setup-python@v4
18- with :
19- python-version : " 3.10"
20- - uses : pre-commit/action@v3.0.0
2113 test :
2214 name : test ${{ matrix.py }} - ${{ matrix.os }}
2315 runs-on : ${{ matrix.os }}
@@ -30,18 +22,19 @@ jobs:
3022 - " 3.8"
3123 - " 3.7"
3224 - " 3.6"
33- - " 3.5"
25+ - pypy-3.9-v7.3.9
26+ - pypy-3.8-v7.3.9
27+ - pypy-3.7-v7.3.9
3428 - pypy-3.6-v7.3.3
35- - pypy-3.7-v7.3.7
36- - pypy-3.8-v7.3.7
37- - " 2.7"
38- - pypy-2.7
3929 os :
4030 - ubuntu-20.04
41- - macos-10.15
31+ - macos-12
4232 - windows-2022
33+ exclude :
34+ - { os: macos-12, py: "pypy-3.6-v7.3.3" } # PyPy 3.6 does not support macOS 11/12
4335 include :
44- - { os: macos-10.15, py: brew@py3 }
36+ - { os: macos-12, py: "brew@3.9" }
37+ - { os: macos-12, py: "brew@3.8" }
4538 steps :
4639 - name : Install OS dependencies
4740 run : |
5447 ${{ runner.os == 'Linux' && 'tar -zxf nushell.tar.gz' || true }} && \
5548 ${{ runner.os == 'Linux' && 'sudo cp nu /usr/bin' || true }} && \
5649 ${{ runner.os == 'Windows' && 'choco install nushell' || true }} && \
57- ${{ runner.os == 'macOS' && 'brew update && brew install fish tcsh nushell' || true }} && \
50+ ${{ runner.os == 'macOS' && 'brew install fish tcsh nushell' || true }} && \
5851 exit 0 || true;
5952 done
6053 exit 1
@@ -63,40 +56,38 @@ jobs:
6356 uses : actions/setup-python@v4
6457 with :
6558 python-version : " 3.10"
66- - name : Install tox
67- run : python -m pip install tox
68- - uses : actions/checkout@v3
69- with :
70- fetch-depth : 0
71- - name : Use local virtualenv for tox
72- run : python -m pip install .
7359 - name : Install Python 2 for cross test
7460 uses : actions/setup-python@v4
7561 with :
7662 python-version : " 2.7"
63+ - name : Setup brew python for test ${{ matrix.py }}
64+ if : startsWith(matrix.py,'brew@')
65+ run : |
66+ set -e
67+ PY=$(echo '${{ matrix.py }}' | cut -c 6-)
68+ brew upgrade python@$PY || brew install python@$PY
69+ echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}"
70+ shell : bash
7771 - name : Setup python for test ${{ matrix.py }}
78- if : " !( startsWith(matrix.py,'brew@py ') || endsWith(matrix.py, '-dev') )"
72+ if : " !( startsWith(matrix.py,'brew@') || endsWith(matrix.py, '-dev') )"
7973 uses : actions/setup-python@v4
8074 with :
8175 python-version : ${{ matrix.py }}
82- - name : Setup brew python for test ${{ matrix.py }}
83- if : startsWith(matrix.py,'brew@py')
84- run : |
85- import subprocess; import codecs; import os
86- subprocess.check_call(["bash", "-c", "brew upgrade python@3 || brew install python@3"])
87- with codecs.open(os.environ["GITHUB_PATH"], "a", "utf-8") as file_handler:
88- file_handler.write("/usr/local/opt/python@3")
89- shell : python
9076 - name : Pick environment to run
9177 run : |
92- import platform; import os; import sys; import codecs
93- cpy = platform.python_implementation() == "CPython"
94- base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
95- env = "TOXENV={}\n".format(base)
96- print("Picked:\n{}for{}".format(env, sys.version))
97- with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
98- file_handler.write(env)
78+ import os; import platform; import sys; from pathlib import Path
79+ env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
80+ print(f"Picked: {env} for {sys.version} based of {sys.executable}")
81+ with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
82+ file_handler.write(env)
9983 shell : python
84+ - uses : actions/checkout@v3
85+ with :
86+ fetch-depth : 0
87+ - name : Install tox
88+ run : python -m pip install tox
89+ - name : Use local virtualenv for tox
90+ run : python -m pip install .
10091 - name : Setup test suite
10192 run : tox -vv --notest
10293 - name : Run test suite
10697 CI_RUN : " yes"
10798 DIFF_AGAINST : HEAD
10899 - name : Rename coverage report file
109- run : import os; import sys; os.rename(".tox/.coverage.{}".format(os.environ['TOXENV']), ".tox/.coverage.{}-{}".format(os.environ['TOXENV'], sys.platform))
100+ run : |
101+ import os; import sys
102+ os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
110103 shell : python
111104 - name : Upload coverage data
112105 uses : actions/upload-artifact@v3
@@ -116,7 +109,7 @@ jobs:
116109
117110 coverage :
118111 name : Combine coverage
119- runs-on : ubuntu-latest
112+ runs-on : ubuntu-22.04
120113 needs : test
121114 steps :
122115 - uses : actions/checkout@v3
@@ -153,7 +146,7 @@ jobs:
153146 fail-fast : false
154147 matrix :
155148 os :
156- - ubuntu-20 .04
149+ - ubuntu-22 .04
157150 - windows-2022
158151 tox_env :
159152 - dev
@@ -181,8 +174,8 @@ jobs:
181174
182175 publish :
183176 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
184- needs : [check, coverage, lint ]
185- runs-on : ubuntu-20 .04
177+ needs : [check, coverage]
178+ runs-on : ubuntu-22 .04
186179 steps :
187180 - name : Setup python to build package
188181 uses : actions/setup-python@v4
0 commit comments