diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..406a393 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Build and Test + +on: [push, pull_request] + +jobs: + test: + name: Setup and Test + runs-on: ubuntu-latest + + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install module + run: pip install .[tests] + + - name: Test with pytest + run: pytest + + - name: Report coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cov.xml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4a8a9e9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -python: - - "3.6" -install: - - pip install ."[tests]" -script: - - pytest -after_success: - - pip install coveralls - - coveralls -notifications: - email: - on_success: change - on_failure: change diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fcbf1d..83d0c5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,12 @@ { "cSpell.words": [ + "AGRC", + "Codecov", + "instafail", "isort", "pylint", - "yapf", "pytest", - "instafail", - "AGRC" + "yapf" ], "coverage-gutters.highlightdark": "rgb(61, 153, 112, .05)", "coverage-gutters.noHighlightDark": "rgb(255, 65, 54, .05)", diff --git a/README.md b/README.md index d25fe3d..c99f1f7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # agrc/python -[![Build Status](https://travis-ci.com/agrc/python.svg?branch=master)](https://travis-ci.com/agrc/python) -[![Coverage Status](https://coveralls.io/repos/github/agrc/python/badge.svg?branch=master)](https://coveralls.io/github/agrc/python?branch=master) +![Build Status](https://github.com/agrc/python/workflows/Build%20and%20Test/badge.svg) +[![codecov](https://codecov.io/gh/agrc/python/branch/main/graph/badge.svg)](https://codecov.io/gh/agrc/python) AGRC's default Python project configuration/template @@ -17,6 +17,7 @@ AGRC's default Python project configuration/template 1. Edit the `setup.py:name, url, project_urls, keywords, and entry_points` to reflect your new project name 1. Edit the `test_projectname.py` to match your project name. - You will have one `test_filename.py` file for each file in your `src` directory and you will write tests for the specific file in the `test_filename.py` file +1. Navigate to [codecov.io](https://codecov.io/gh/agrc/python) and create a `CODECOV_TOKEN` [project secret](https://github.com/agrc/python/settings/secrets) 1. Install an editable package for development - `pip install -e ".[tests]"` - add any project requirements to the `setup.py:install_requires` array