diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..83f06b6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,60 @@ +name: tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Third-party actions are pinned by full commit SHA (with a `# vN.M.P` +# comment noting the tag at pin time) so that supply-chain attacks on the +# action repos can't silently introduce new behavior. Dependabot/renovate +# can bump these the same way it bumps any other dependency. + +jobs: + style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: '3.12' + - name: Install style tools + run: | + python -m pip install --upgrade pip + pip install black flake8 pep8-naming + - name: black + run: black --diff --check . + - name: flake8 + run: flake8 + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + # Tests run `git blame` against historical SHAs in the repo's own + # history; the default shallow clone (fetch-depth: 1) breaks them. + fetch-depth: 0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: ${{ matrix.python-version }} + - name: Install + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt coverage + pip install -e . + - name: Run tests + run: PYTHONPATH=. coverage run $(which pytest) + - name: Upload coverage to Codecov + uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 + with: + flags: py${{ matrix.python-version }} + token: ${{ secrets.CODECOV_TOKEN }} + env: + OS: ${{ runner.os }} + PYTHON: ${{ matrix.python-version }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9003af1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -branches: - only: - - master - -jobs: - fast_finish: true - include: - - stage: "style check" - python: '3.7' - os: linux - language: python - script: - - black --diff --check . - - flake8 - - stage: "unit tests" - python: '3.5' - os: linux - language: python - - python: '3.6' - os: linux - language: python - - python: '3.7' - os: linux - language: python - - python: '3.8-dev' - os: linux - language: python - -install: - - pip install --upgrade -r requirements.txt - - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" ]]; then - pip install --upgrade black; - pip install --upgrade flake8; - pip install --upgrade pep8-naming; - fi - - python setup.py install - -script: - - PYTHONPATH=. coverage run $(which pytest) - -after_success: - - codecov --env PYTHON_VERSION --required --flags "${TEST_SUITE}${TRAVIS_OS_NAME}" - -notifications: - email: - recipients: tgamblin@llnl.gov - on_success: change - on_failure: always diff --git a/README.md b/README.md index 0781236..7b1b6e1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Contrib [![PyPI version](https://badge.fury.io/py/contrib.svg)](https://badge.fury.io/py/contrib) -[![Build Status](https://travis-ci.com/spack/contrib.svg?branch=master)](https://travis-ci.com/spack/contrib) -[![codecov](https://codecov.io/gh/spack/contrib/branch/master/graph/badge.svg)](https://codecov.io/gh/spack/contrib) +[![tests](https://github.com/spack/contrib/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/spack/contrib/actions/workflows/tests.yml) +[![codecov](https://codecov.io/gh/spack/contrib/branch/main/graph/badge.svg)](https://codecov.io/gh/spack/contrib) [![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) A python package for making stacked area plots of contributions to a git diff --git a/contrib/main.py b/contrib/main.py index 467a655..6c4c63c 100644 --- a/contrib/main.py +++ b/contrib/main.py @@ -9,7 +9,6 @@ import bisect import collections import contextlib -import glob import json import sys import re