From 001d09b24619b36db28664a020e927539f495c13 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 24 Aug 2020 12:39:01 -0400 Subject: [PATCH 1/6] 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/6] 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/6] 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/6] 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/6] 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/6] 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", ]