-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: replace travis with github actions
- Loading branch information
Showing
4 changed files
with
163 additions
and
89 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "release-*" | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "release-*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, windows-latest, macos-latest] | ||
pyv: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.pyv }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.pyv }} | ||
|
||
- name: set PY_CACHE_KEY | ||
run: echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | ||
- name: Cache .tox | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ github.workspace }}/.tox/checkqa | ||
key: "tox-lint|${{ matrix.os }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}" | ||
|
||
- name: Update pip/setuptools | ||
run: | | ||
pip install -U pip setuptools | ||
- name: Install tox | ||
run: python -m pip install tox | ||
|
||
- name: Version information | ||
run: python -m pip list | ||
|
||
- name: Lint | ||
run: tox -v -e checkqa |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Publish package to PyPI | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install requirements | ||
run: | | ||
pip install -U pip twine build | ||
- name: Build | ||
run: python -m build | ||
- run: check-manifest | ||
- run: twine check dist/* | ||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: "__token__" | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: twine upload dist/* |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "release-*" | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "release-*" | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTEST_ADDOPTS: "-vv --cov-report=xml:coverage-ci.xml" | ||
PIP_DISABLE_PIP_VERSION_CHECK: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
tests: | ||
name: Tests | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 5 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, windows-latest, macos-latest] | ||
python: ["3.8"] | ||
tox_env: ["coverage"] | ||
include: | ||
- tox_env: "py39-coverage" | ||
os: ubuntu-20.04 | ||
python: "3.9" | ||
- tox_env: "py310-coverage" | ||
python: "3.10" | ||
os: ubuntu-20.04 | ||
- tox_env: "py311-coverage" | ||
python: "3.11" | ||
os: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: set PY_CACHE_KEY | ||
run: echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | ||
- name: Cache .tox | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ github.workspace }}/.tox/${{ matrix.tox_env }} | ||
key: "tox|${{ matrix.os }}|${{ matrix.tox_env }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}" | ||
|
||
- name: Update tools and print info | ||
run: | | ||
pip install -U pip setuptools virtualenv | ||
pip list | ||
- name: Install tox | ||
run: pip install tox | ||
|
||
- name: Setup tox environment | ||
id: setup_tox | ||
run: tox --notest -v -e ${{ matrix.tox_env }} | ||
|
||
- name: Run tests | ||
run: | | ||
python -m tox -v -e ${{ matrix.tox_env }} | ||
- name: Report coverage | ||
if: always() && (contains(matrix.tox_env, 'coverage') && (steps.setup_tox.outcome == 'success')) | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
files: ./coverage-ci.xml | ||
flags: ${{ runner.os }} | ||
name: ${{ matrix.tox_env }} | ||
fail_ci_if_error: true |
This file was deleted.
Oops, something went wrong.