From 001d09b24619b36db28664a020e927539f495c13 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 12:39:01 -0400 Subject: [PATCH 1/8] Add github workflows --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 29 +++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..41c23f7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - name: Install Python dependencies + run: python -m pip install --upgrade pip wheel + + - name: Build the packages + id: build + run: | + python setup.py sdist bdist_wheel + # Get the name of the .whl and .tar.gz files and set them as + # "outputs" of this step so we can upload them + echo "::set-output name=bdist_wheel::$(cd dist && ls *.whl)" + echo "::set-output name=sdist::$(cd dist && ls *.tar.gz)" + - name: Upload the wheel + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/${{ steps.build.outputs.bdist_wheel }} + asset_name: ${{ steps.build.outputs.bdist_wheel }} + asset_content_type: application/zip + + - name: Upload the source distribution + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/${{ steps.build.outputs.sdist }} + asset_name: ${{ steps.build.outputs.sdist }} + asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d7c9412 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: test + +on: [pull_request, push] + +jobs: + test: + name: test + runs_on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox coveralls + + - name: Run tox + run: | + tox + coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + + \ No newline at end of file From 67fb150a41eb11cd0c279c00fe5e8071d2f37023 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 12:40:39 -0400 Subject: [PATCH 2/8] Fix runs_on --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7c9412..4f0cd09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: [pull_request, push] jobs: test: name: test - runs_on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 From f3470ed719c4cdfa8eb70759599705c6c0b5f876 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 12:43:06 -0400 Subject: [PATCH 3/8] Add GITHUB_TOKEN to env --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f0cd09..122440a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,5 +25,5 @@ jobs: coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file From c2090dd2cbc3d133c14d1abe900c54008ce6b1e9 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 13:28:07 -0400 Subject: [PATCH 4/8] Specify version range for coverage file --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 122440a..3bb37fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox coveralls + pip install tox coverage>=4.5.1,<5 coveralls - name: Run tox run: | From 41a65ff3baac07995e1ac694ca5f014f9987bd62 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 13:32:46 -0400 Subject: [PATCH 5/8] revert coverage --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bb37fa..122440a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox coverage>=4.5.1,<5 coveralls + pip install tox coveralls - name: Run tox run: | From 778b23624bb24c0d226870e2bc2dd58d3a60adec Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 13:42:50 -0400 Subject: [PATCH 6/8] Bump coverage version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 673f958..5014a09 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ ] testing_extras = [ - "coverage>=4.5.1,<5", + "coverage>=5.0,<6", "mock==2.0.0", "model_mommy>=1.6.0,<1.7", ] From 73ed793c9bf300b4b61ecdad402fb0e81c047b28 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 13:45:47 -0400 Subject: [PATCH 7/8] Remove the travis file --- .travis.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f0a34ed..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: python -python: -- 3.6 -install: -- pip install tox-travis -script: -- tox -- python setup.py bdist_wheel -after_success: -- coveralls -deploy: - provider: releases - skip_cleanup: true - api_key: - secure: JSajnwpeUixOaWnQzaQCmeg9/74h/QKFtz7difgKuUg7SmuY462Jyr2mkTQkYQWPR28lqB/pIp7DlTjrN9inxpdtVpsm0RSgvuzvW7ZmlWr2xLb6wjHMArtRVJsdqODauQa9EH2ArqeKvXrCqWP2LQI6RFgoElOH3ilcemElj+w= - file_glob: true - file: dist/*.whl - on: - tags: true From 959d2596b782633178285fc2458642b676b5d1eb Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 13:46:42 -0400 Subject: [PATCH 8/8] Update README badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b7fc64..3a80ac0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build # Status](https://travis-ci.org/cfpb/owning-a-home-api.svg?branch=master)](https://travis-ci.org/cfpb/owning-a-home-api) [![Coverage Status](https://coveralls.io/repos/cfpb/owning-a-home-api/badge.svg?branch=master)](https://coveralls.io/r/cfpb/owning-a-home-api?branch=master) +![Build Status](https://github.com/cfpb/owning-a-home-api/workflows/test/badge.svg)[![Coverage Status](https://coveralls.io/repos/cfpb/owning-a-home-api/badge.svg?branch=master)](https://coveralls.io/r/cfpb/owning-a-home-api?branch=master) # Owning a Home API