-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba3541c
commit 878c6e0
Showing
7 changed files
with
83 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,32 +15,32 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected].0 | ||
- uses: pre-commit/[email protected].3 | ||
|
||
test: | ||
name: test ${{ matrix.py }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
py: | ||
- 3.10.0-rc.1 | ||
- 3.9 | ||
- 3.8 | ||
- 3.7 | ||
- 3.6 | ||
- 3.5 | ||
- pypy-3.6-v7.3.7 | ||
- "3.10" | ||
- "3.9" | ||
- "3.8" | ||
- "3.7" | ||
- "3.6" | ||
- "3.5" | ||
- pypy-3.6-v7.3.3 | ||
- pypy-3.7-v7.3.7 | ||
- pypy-3.8-v7.3.7 | ||
- 2.7 | ||
- "2.7" | ||
- pypy-2.7 | ||
os: | ||
- ubuntu-20.04 | ||
- macos-10.15 | ||
- windows-2022 | ||
include: | ||
- { os: macos-latest, py: brew@py3 } | ||
- { os: macos-10.15, py: brew@py3 } | ||
steps: | ||
- name: Install OS dependencies | ||
run: | | ||
|
@@ -61,14 +61,18 @@ jobs: | |
- name: Setup python for tox | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.10" | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use local virtualenv for tox | ||
run: python -m pip install . | ||
- name: Install Python 2 for cross test | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "2.7" | ||
- name: Setup python for test ${{ matrix.py }} | ||
if: "!( startsWith(matrix.py,'brew@py') || endsWith(matrix.py, '-dev') )" | ||
uses: actions/setup-python@v2 | ||
|
@@ -78,7 +82,7 @@ jobs: | |
if: startsWith(matrix.py,'brew@py') | ||
run: | | ||
import subprocess; import codecs; import os | ||
subprocess.check_call(["bash", "-c", f"brew upgrade python@3 || brew install python@3"]) | ||
subprocess.check_call(["bash", "-c", "brew upgrade python@3 || brew install python@3"]) | ||
with codecs.open(os.environ["GITHUB_PATH"], "a", "utf-8") as file_handler: | ||
file_handler.write("/usr/local/opt/python@3") | ||
shell: python | ||
|
@@ -101,14 +105,45 @@ jobs: | |
CI_RUN: "yes" | ||
DIFF_AGAINST: HEAD | ||
- name: Rename coverage report file | ||
run: | | ||
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml') | ||
run: import os; import sys; os.rename(".tox/.coverage.{}".format(os.environ['TOXENV']), ".tox/.coverage.{}-{}".format(os.environ['TOXENV'], sys.platform)) | ||
shell: python | ||
- uses: codecov/codecov-action@v1 | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
file: ./.tox/coverage.xml | ||
flags: tests | ||
name: ${{ matrix.py }} - ${{ matrix.os }} | ||
name: coverage-data | ||
path: ".tox/.coverage.*" | ||
|
||
coverage: | ||
name: Combine coverage | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Setup coverage tool | ||
run: tox -e coverage --notest | ||
- name: Install package builder | ||
run: python -m pip install build | ||
- name: Build package | ||
run: pyproject-build --wheel . | ||
- name: Download coverage data | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: coverage-data | ||
path: .tox | ||
- name: Combine and report coverage | ||
run: tox -e coverage | ||
- name: Upload HTML report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: html-report | ||
path: .tox/htmlcov | ||
|
||
check: | ||
name: ${{ matrix.tox_env }} - ${{ matrix.os }} | ||
|
@@ -117,25 +152,25 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- ubuntu-20.04 | ||
- windows-2022 | ||
tox_env: | ||
- dev | ||
- docs | ||
- readme | ||
- upgrade | ||
- zipapp | ||
exclude: | ||
- { os: windows-latest, tox_env: readme } | ||
- { os: windows-latest, tox_env: docs } | ||
- { os: windows-2022, tox_env: readme } | ||
- { os: windows-2022, tox_env: docs } | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python 3.9 | ||
- name: Setup Python "3.10" | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.10" | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Run check for ${{ matrix.tox_env }} | ||
|
@@ -145,13 +180,13 @@ jobs: | |
|
||
publish: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [check, test, lint] | ||
runs-on: ubuntu-latest | ||
needs: [check, coverage, lint] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Setup python to build package | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
python-version: "3.10" | ||
- name: Install https://pypi.org/project/build | ||
run: python -m pip install build | ||
- uses: actions/checkout@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters