Skip to content

Commit

Permalink
Skip upload when tox runs locally
Browse files Browse the repository at this point in the history
  • Loading branch information
cemsbr committed Nov 15, 2021
1 parent 6cb6279 commit 9ec10bb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
# Without quotes, 3.10 becomes 3.1
python-version: [3.9, 3.6, 3.7, 3.8, '3.10']
python-version: ['3.9', '3.6', '3.7', '3.8', '3.10']

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -37,10 +37,20 @@ jobs:
- name: Install tox
run: pip install -U tox

- name: Run tox
- name: Test
run: tox

- name: Lint
if: ${{ matrix.python-version == '3.9' }}
run: tox
env:
TOXENV: lint

- name: Upload results
if: ${{ matrix.python-version == '3.9' }}
run: tox
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
TOXENV: ${{ matrix.python-version }}
TOXENV: upload
27 changes: 13 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
[tox]
envlist = 3.6,3.7,3.8,3.9,3.10,collect_reports
envlist = py36,py37,py38,py39,py310
skip_missing_interpreters = true

[testenv]
whitelist_externals = rm

[testenv:{3.6,3.7,3.8,3.10}]
commands=
; Force packaging even if setup.{py,cfg} haven't changed
rm -rf ./yala.egg-info/
pip install -U .[all,black,flake8]
python setup.py test

[testenv:3.9]
[testenv:lint]
; Code checks and linters are run in the latest stable Python version only.
depends = collect_reports
parallel_show_output = true
passenv=
CODACY_PROJECT_TOKEN
CODECOV_TOKEN
COVERALLS_REPO_TOKEN
deps=
coveralls
codecov
codacy-coverage
commands=
; Force packaging even if setup.{py,cfg} haven't changed
rm -rf ./yala.egg-info/
Expand All @@ -39,6 +27,17 @@ commands=
rstcheck README.rst
coverage report

[testenv:upload]
depends = lint
passenv=
CODACY_PROJECT_TOKEN
CODECOV_TOKEN
COVERALLS_REPO_TOKEN
deps=
coveralls
codecov
codacy-coverage
commands=
coverage xml
coveralls
codecov
Expand Down

0 comments on commit 9ec10bb

Please sign in to comment.