Skip to content

Commit

Permalink
Merge pull request #61 from Princeton-CDH/feature/chore/github-actions
Browse files Browse the repository at this point in the history
use GitHub Actions for CI
  • Loading branch information
rlskoeser committed May 3, 2021
2 parents f67570f + dcff879 commit caaa16e
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 48 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: unit tests

on:
push: # run on every push or PR to any branch
pull_request:
schedule: # run automatically on main branch each Tuesday at 11am
- cron: "0 16 * * 2"

jobs:
python-unit:
name: Python unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.6, 3.8]
solr: [8.6, 6.6]
django: [0, 2.2, 3.0, 3.1]
# We use service containers to avoid needing to set up a local copy of
# mysql or postgres on the test runner instance. This syntax is similar to
# the spec of a docker-compose file. For more, see:
# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
services:
solr:
image: solr:${{ matrix.solr }}
ports:
- 8983:8983
steps:
- name: Copy solr configsets to solr home directory (Solr 8 only)
run: "docker exec -d ${{ job.services.solr.id }} cp -r /opt/solr/server/solr/configsets /var/solr/data"
if: ${{ matrix.solr == 8.6 }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

# We base the python cache on the hash of all requirements files, so that
# if any change, the cache is invalidated.
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('setup.py') }}
restore-keys: |
pip-${{ hashFiles('setup.py') }}
pip-
- name: Install package with dependencies
run: |
if [ "${{ matrix.django }}" -gt "0"]; then pip install -q Django==${{ matrix.django }} pytest-django; fi
pip install -e .
pip install -e '.[test]'
pip install codecov
- name: Setup test settings
run: |
cp ci/testsettings.py testsettings.py
python -c "import uuid; print('SECRET_KEY = \'%s\'' % uuid.uuid4())" >> testsettings.py
- name: Run pytest
env:
SOLR_VERSION: "${{ matrix.solr }}"
run: py.test --cov=parasolr --cov-report=xml

- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v1
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
CHANGELOG
=========

0.7
---

* Dropped support for Python 3.5
* Now tested against Python 3.6, 3.8, Django 2.2—3.1, Solr 6 and Solr 8
* Continuous integration migrated from Travis-CI to GitHub Actions

0.6.1
-----

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ configuration and indexing content.
:target: https://requires.io/github/Princeton-CDH/parasolr/requirements/?branch=main
:alt: Requirements Status

Currently tested against Python 3.5 and 3.6, Solr 6.6.5 and 8.6.2, and Django 2.2 and without Django.
Currently tested against Python 3.6 and 3.8, Solr 6.6.5 and 8.6.2, and Django 2.2-3.1 and without Django.


Installation
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
DEV_REQUIREMENTS = ['sphinx', 'sphinxcontrib-napoleon',
'sphinx-autodoc-typehints']
# django integration is optional
DJANGO_REQUIREMENTS = ['django>=1.11', 'pytest-django>=3.6']
DJANGO_REQUIREMENTS = ['django>=2.2', 'pytest-django>=3.6']

setup(
name='parasolr',
Expand All @@ -41,17 +41,17 @@
'Environment :: Web Environment',
'Development Status :: 2 - Pre-Alpha',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Pytest',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.8',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Database',
],
Expand Down

0 comments on commit caaa16e

Please sign in to comment.