diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..4edd7b1 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +relative_files = True diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..04b4672 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,75 @@ +name: CI + +on: + push: + paths-ignore: + - "*.md" + +jobs: + build: + # For compatibility with Python 3.4 + runs-on: ubuntu-18.04 + strategy: + matrix: + python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Prepare Environment + run: | + python -m pip install --upgrade pip + pip install pytest==3.8.2 + pip install coveralls + pip install -e ".[dev]" + + - name: Flake8 + run: | + flake8 quaternions + + - name: Tests (3.4) + # Avoid .coveragerc in 3.4 + if: + matrix.python-version == 3.4 + run : | + pytest -v tests/ + + - name: Tests + if: + matrix.python-version >= 3.5 + run: | + pytest -v --cov=quaternions --cov-report= tests/ + + - name: Publish coverage to Coveralls + # If pushed / is a pull request against main repo + if: + ((github.event_name == 'push' && github.repository == 'satellogic/quaternions') || + github.event.pull_request.base.repo.full_name == 'satellogic/quaternions') && matrix.python-version >= 3.5 + uses: AndreMiras/coveralls-python-action@v20201129 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: py${{ matrix.python-version }} + parallel: true + debug: true + + coveralls-finish: + needs: build + # If pushed / is a pull request against main repo + if: + (github.event_name == 'push' && github.repository == 'satellogic/quaternions') || + github.event.pull_request.base.repo.full_name == 'satellogic/quaternions' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Coveralls finished + uses: AndreMiras/coveralls-python-action@v20201129 + with: + parallel-finished: true + debug: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 58d5997..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: python - -python: - - "3.4" - - "3.5" - - "3.5-dev" - - "3.6" - - "3.6-dev" - - "3.7" - - "3.8" - - "nightly" - -matrix: - allow_failures: - - python: "nightly" - -install: - - pip install --editable .[dev] - - if [[ $TRAVIS_PYTHON_VERSION < 3.5 ]] ; then pip install 'pytest==3.8.2' ; elif [[ $TRAVIS_PYTHON_VERSION < 3.6 ]] ; then pip install 'pytest>=5.4.3' ; fi - - pip install coveralls -script: - - pytest -v --cov-report= --cov=quaternions tests/ -after_script: - - flake8 quaternions - -# report coverage to coveralls.io -after_success: - - coveralls - -cache: - apt: true - pip: true diff --git a/README.md b/README.md index 5f92057..438aae5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Quaternions library =================== [![Coverage Status](https://coveralls.io/repos/github/satellogic/quaternions/badge.svg)](https://coveralls.io/github/satellogic/quaternions) -[![Build Status](https://travis-ci.org/satellogic/quaternions.svg?branch=add_travis_ci)](https://travis-ci.org/satellogic/quaternions) +[![CI](https://github.com/satellogic/quaternions/actions/workflows/cicd.yml/badge.svg)](https://github.com/satellogic/quaternions/actions/workflows/cicd.yml) This is a library for dealing with quaternions in python in a unified way.