diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2021-04-22 22:40:52 +0300 |
---|---|---|
committer | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2021-09-13 11:54:57 +0300 |
commit | 6923aee503ac81c26d2425592e90a2254c7666d9 (patch) | |
tree | ca5ffeff7069564f9fa0ac52b14e16c48188430e | |
parent | 27cebc56a0f6a900eeb897512879d545095f410b (diff) | |
download | isodate-6923aee503ac81c26d2425592e90a2254c7666d9.tar.gz |
Move from Travis CI to GitHub Actions and Coveralls to Codecov
-rw-r--r-- | .github/workflows/lint.yml | 12 | ||||
-rw-r--r-- | .github/workflows/test.yml | 59 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 12 | ||||
-rw-r--r-- | .travis.yml | 24 | ||||
-rw-r--r-- | tox.ini | 21 |
6 files changed, 94 insertions, 35 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..6f8c677 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bab2ac2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,59 @@ +name: Test + +on: [push, pull_request] + +env: + FORCE_COLOR: 1 + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] + os: [ubuntu-latest, macos-latest, windows-latest] + include: + # Include new variables for Codecov + - { codecov-flag: GHA_Ubuntu, os: ubuntu-latest } + - { codecov-flag: GHA_macOS, os: macos-latest } + - { codecov-flag: GHA_Windows, os: windows-latest } + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: + ${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ + hashFiles('**/setup.py') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}-v1- + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U wheel + python -m pip install -U tox + + - name: Tox tests + run: | + tox -e py + + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + flags: ${{ matrix.codecov-flag }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }} @@ -10,4 +10,5 @@ develop-eggs dist parts .coverage +coverage.xml htmlcov diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..763d597 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + + - repo: https://github.com/pycqa/flake8 + rev: 3.9.1 + hooks: + - id: flake8 + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-merge-conflict + - id: check-yaml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab80767..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -matrix: - include: - - python: 2.7 - env: TOXENV=py27 - - python: 3.4 - env: TOXENV=py34 - - python: 3.5 - env: TOXENV=py35 - - python: 3.6 - env: TOXENV=py36 - - python: 3.5 - env: TOXENV=flake - - python: 3.5 - env: TOXENV=cover -install: - - pip install tox -script: - - tox -after_script: - - if [ $TOXENV == "cover" ]; then - pip install --quiet coveralls; - coveralls; - fi @@ -1,20 +1,19 @@ [tox] -envlist = py27,py34,py35,py36,pypy,pypy3,flake,cover +envlist = + lint + py{36, 37, 38, 39, py3} [testenv] deps = commands = {envpython} setup.py test - -[testenv:flake] -basepython = python3.5 -commands= - pip install --quiet flake8 - {envpython} setup.py clean --all flake8 - -[testenv:cover] -basepython = python3.5 -commands = pip install --quiet coverage {envpython} setup.py clean --all coverage run setup.py test + coverage xml + +[testenv:lint] +deps = pre-commit +commands = pre-commit run --all-files +skip_install = true +passenv = PRE_COMMIT_COLOR |