From efba060b0199326f029e649ce3779c49ac69c743 Mon Sep 17 00:00:00 2001 From: Danny Roberts Date: Fri, 11 Mar 2022 15:27:30 -0600 Subject: [PATCH 1/6] Run tests using github actions --- .github/workflows/tests.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..b1acce1 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Run tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["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 . + - name: Run tests + run: | + python setup.py test + - name: Test cython files + run: | + .travis/install_cython.sh + .travis/test_cython_files.sh From 24f2d0f24de214076386664f7f13419422479581 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Fri, 11 Mar 2022 15:37:19 -0600 Subject: [PATCH 2/6] Rename .travis => scripts --- .github/workflows/tests.yml | 4 ++-- .travis.yml | 4 ++-- {.travis => scripts}/install_cython.sh | 0 {.travis => scripts}/test_cython_files.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename {.travis => scripts}/install_cython.sh (100%) rename {.travis => scripts}/test_cython_files.sh (94%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b1acce1..ed70f60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,5 +33,5 @@ jobs: python setup.py test - name: Test cython files run: | - .travis/install_cython.sh - .travis/test_cython_files.sh + scripts/install_cython.sh + scripts/test_cython_files.sh diff --git a/.travis.yml b/.travis.yml index af9dcc7..d94a3d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,5 @@ python: install: "pip install ." script: - "python setup.py test" - - "if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then .travis/install_cython.sh; fi" - - "if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then .travis/test_cython_files.sh; fi" + - "if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then scripts/install_cython.sh; fi" + - "if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then scripts/test_cython_files.sh; fi" diff --git a/.travis/install_cython.sh b/scripts/install_cython.sh similarity index 100% rename from .travis/install_cython.sh rename to scripts/install_cython.sh diff --git a/.travis/test_cython_files.sh b/scripts/test_cython_files.sh similarity index 94% rename from .travis/test_cython_files.sh rename to scripts/test_cython_files.sh index 1ba7aa5..be2fec1 100755 --- a/.travis/test_cython_files.sh +++ b/scripts/test_cython_files.sh @@ -11,7 +11,7 @@ if git diff --quiet HEAD --; then exit 0 else echo "=====================================" - echo "ERROR: ./.travis/test_cython_files.sh" + echo "ERROR: ./scripts/test_cython_files.sh" echo "-------------------------------------" git diff HEAD -- | head -n 20 echo "-------------------------------------" From fd0611a0b2b313f5564099e499b0350a0cde21f5 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Fri, 11 Mar 2022 15:37:46 -0600 Subject: [PATCH 3/6] Remove .travis.yml --- .travis.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d94a3d9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: python -python: - - 2.7 - - 3.5 - - 3.6 - - 3.7 - - 3.8 - - 3.9 -install: "pip install ." -script: - - "python setup.py test" - - "if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then scripts/install_cython.sh; fi" - - "if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then scripts/test_cython_files.sh; fi" From 6b6c3611d19d1b924ba8fdf8a21271bc4bbb33f5 Mon Sep 17 00:00:00 2001 From: Danny Roberts Date: Fri, 11 Mar 2022 15:44:02 -0600 Subject: [PATCH 4/6] Run github actions on PRs to any branch Co-authored-by: Peter Law --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ed70f60..b2bb934 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,6 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] jobs: build: From d138e17918552616cd0d2f25b5dc294f50d4e785 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Fri, 11 Mar 2022 16:36:49 -0600 Subject: [PATCH 5/6] Update build badge to reference github actions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14b6c8e..b9dc585 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # jsonobject -[![Build Status](https://travis-ci.org/dimagi/jsonobject.png)](https://travis-ci.org/dimagi/jsonobject) +[![Build Status](https://github.com/dimagi/jsonobject/actions/workflows/tests.yml/badge.svg)](https://github.com/dimagi/jsonobject/actions/workflows/tests.yml) jsonobject is a python library for handling deeply nested JSON objects as well-schema'd python objects. From 86c05339a57b302db8f44937561cb56aaeff6a5d Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Fri, 11 Mar 2022 16:38:51 -0600 Subject: [PATCH 6/6] Update .github/workflows/tests.yml name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b2bb934..82acb34 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Run tests +name: jsonobject tests on: push: