From 610bc6a04c5617fb5d28334895cfd0b8b86a26ea Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 12:33:09 -0600 Subject: [PATCH 1/8] refactor: replace travis with github action --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ .travis.yml | 14 -------------- 2 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cd3adcd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +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 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 From 19f323339b2bb754a672eaa3b50d8ed944877a90 Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 12:33:18 -0600 Subject: [PATCH 2/8] docs: update badge to github action --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d25fe3d..723896e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # agrc/python -[![Build Status](https://travis-ci.com/agrc/python.svg?branch=master)](https://travis-ci.com/agrc/python) +![Build Status](https://github.com/agrc/python/workflows/Build%20and%20Test/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/agrc/python/badge.svg?branch=master)](https://coveralls.io/github/agrc/python?branch=master) AGRC's default Python project configuration/template From 423190547a67803f68f6f7381c1390c20cf9db19 Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 12:37:11 -0600 Subject: [PATCH 3/8] chore: add code coverage repoprting --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd3adcd..3bccab7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,3 +21,8 @@ jobs: - name: Test with pytest run: pytest + + - name: Report code coverage with coveralls + run: | + pip install coveralls + coveralls From c12c109ba0b9b078c01c1438afe07043f07cb9d4 Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 12:39:45 -0600 Subject: [PATCH 4/8] chore: use official action --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bccab7..0100ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Test with pytest run: pytest - - name: Report code coverage with coveralls - run: | - pip install coveralls - coveralls + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From 1d69afc4d5fe3329f7bfd7e19d51564a9256ba01 Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 12:44:30 -0600 Subject: [PATCH 5/8] chore: update path to coverage --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0100ec5..da3e14c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,3 +26,5 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./cov.xml + flag-name: Unit From 42fe9c8736905dbffcc292978f5ec62ccb3afdae Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 13:07:11 -0600 Subject: [PATCH 6/8] refactor: swtich to codecov --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da3e14c..e28d94b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,8 @@ jobs: - name: Test with pytest run: pytest - - name: Coveralls - uses: coverallsapp/github-action@master + - name: Report coverate to Codecov + uses: codecov/codecov-action@v1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./cov.xml - flag-name: Unit + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cov.xml From af0f8bd04d6071fd3081c79bdd93fe3a07251f3e Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 13:14:21 -0600 Subject: [PATCH 7/8] docs: turn on code coverage --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 723896e..c99f1f7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # agrc/python ![Build Status](https://github.com/agrc/python/workflows/Build%20and%20Test/badge.svg) -[![Coverage Status](https://coveralls.io/repos/github/agrc/python/badge.svg?branch=master)](https://coveralls.io/github/agrc/python?branch=master) +[![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 From 3021376c32d13b78491fe9c591e24416d61d74f0 Mon Sep 17 00:00:00 2001 From: steveoh Date: Wed, 14 Oct 2020 13:31:23 -0600 Subject: [PATCH 8/8] chore: fix spelling --- .github/workflows/ci.yml | 2 +- .vscode/settings.json | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e28d94b..406a393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Test with pytest run: pytest - - name: Report coverate to Codecov + - name: Report coverage to Codecov uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} 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)",