diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml deleted file mode 100644 index d6783e2..0000000 --- a/.github/workflows/blank.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. diff --git a/.github/workflows/spherical_geometry.yml b/.github/workflows/spherical_geometry.yml new file mode 100644 index 0000000..0629144 --- /dev/null +++ b/.github/workflows/spherical_geometry.yml @@ -0,0 +1,75 @@ +name: Spherical Geometry CI + +# Change 'on' section and add code coverage. + +on: + push: + branches: + - master + tags: + - "*" + pull_request: + branches: + +jobs: + build: + name: Python Testing ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e .[test] + - name: Test with pytest + run: | + pytest + + doc_build: + name: Document Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + sudo apt-get install graphviz texlive-latex-extra dvipng + python -m pip install --upgrade pip + python -m pip install -e .[docs] + - name: Build documents with sphinx + run: | + sphinx-build docs build/docs + + code_coverage: + name: Code Coverage Report + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e .[test] + - name: Test with pytest and code coverage + run: | + pytest --cov-report=xml --cov=. --cov-config=setup.cfg + - name: Upload coverage to codecoverage + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1099f13..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -dist: xenial - -language: python - -addons: - apt: - packages: - - graphviz - - libopenblas-dev - - libqd-dev - -os: - - linux - -python: - - "3.6" - - "3.7" - -env: - global: - - USE_SYSTEM_QD="" - -matrix: - include: - - os: linux - python: 3.6 - env: - - USE_SYSTEM_QD=1 - - allow_failures: - - os: linux - python: 3.6 - env: - - USE_SYSTEM_QD=1 - -install: - # default python provides an incompatible version of numpy (1.15.x) for python 3.7 - - pip install --upgrade pip setuptools numpy scipy - - pip install -e ".[test]" - -script: - - pytest diff --git a/setup.cfg b/setup.cfg index 454e6af..19aa56d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,3 +26,10 @@ project_urls = Bug Reports = https://github.com/spacetelescope/spherical_geometry/issues/ Source = https://github.com/spacetelescope/spherical_geometry/ Help = https://hsthelp.stsci.edu + +[coverage:run] +omit = + spherical_geometry/tests/* + # And list again for running against installed versions + */spherical_geometry/tests/* + diff --git a/setup.py b/setup.py index 2d15a98..52aefd5 100644 --- a/setup.py +++ b/setup.py @@ -139,6 +139,7 @@ def qd_config(arg): extras_require={ 'test': [ 'pytest', + 'pytest-cov', ], 'docs': [ 'sphinx',