forked from justquick/django-activity-stream
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
582 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Test and deploy | ||
|
||
# define when to run the action | ||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
GITHUB_WORKFLOW: true | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-20.04 | ||
|
||
# test matrix | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- 3.6 | ||
- 3.7 | ||
- 3.8 | ||
- 3.9 | ||
django: | ||
- 2.2 | ||
- 3.0 | ||
- 3.1 | ||
database: | ||
- sqlite | ||
- mysql | ||
- postgres | ||
|
||
# additional service containers to run | ||
services: | ||
# postgres service | ||
postgres: | ||
# docker hub image | ||
image: postgres:13-alpine | ||
# configure the instance | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
# set health checks to wait until service has started | ||
options: >- | ||
--health-cmd="pg_isready" | ||
--health-interval=10s | ||
--health-timeout=5s | ||
--health-retries=5 | ||
# mysql service | ||
mysql: | ||
# docker hub image | ||
image: mysql:8 | ||
# configure the instance | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
MYSQL_DATABASE: test | ||
ports: | ||
- 3306:3306 | ||
# set health checks to wait until service has started | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval=10s | ||
--health-timeout=5s | ||
--health-retries=5 | ||
steps: | ||
# check out revision to test | ||
- uses: actions/checkout@v2 | ||
|
||
# install python | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# upgrade pip | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
|
||
# install environment specific dependencies | ||
- name: Install coverage | ||
run: pip install coverage>=5.3 | ||
- name: Install Django 2.2 | ||
if: matrix.django == 2.2 | ||
run: pip install "Django>=2.2,<3.0" | ||
- name: Install Django 3.0 | ||
if: matrix.django == 3.0 | ||
run: pip install "Django>=3.0,<3.1" | ||
- name: Install Django 3.1 | ||
if: matrix.django == 3.1 | ||
run: pip install "Django>=3.1,<3.2" | ||
- name: Install MySQL libs | ||
if: matrix.database == 'mysql' | ||
run: pip install mysqlclient>=2.0.1 django-mysql>=3.9.0 | ||
- name: Install postgres libs | ||
if: matrix.database == 'postgres' | ||
run: pip install psycopg2>=2.8.6 | ||
- name: Install django-jsonfield-backport | ||
if: matrix.django == 2.2 || matrix.django == 3.0 | ||
run: pip install "django-jsonfield-backport>=1.0.2,<2.0" | ||
|
||
# install our package | ||
- name: Install package | ||
run: pip install -e . | ||
|
||
# execute the tests | ||
- name: Run tests | ||
run: coverage run runtests/manage.py test -v3 --noinput actstream testapp testapp_nested | ||
env: | ||
DATABASE_ENGINE: ${{ matrix.database }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM ubuntu:focal | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV LC_ALL=C.UTF-8 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# the base image is also built using this Dockerfile, so we have to reset this | ||
USER root | ||
|
||
RUN apt-get -y update && apt-get -y --no-install-recommends install \ | ||
build-essential \ | ||
gcc \ | ||
gettext \ | ||
python3-dev \ | ||
python3-venv \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /usr/share/doc/* /usr/share/locale/* /usr/share/man/* && \ | ||
mkdir -p /app && \ | ||
(useradd -m app || true) | ||
|
||
COPY --from=library/docker:latest /usr/local/bin/docker /usr/bin/docker | ||
COPY --from=docker/compose:1.23.2 /usr/local/bin/docker-compose /usr/bin/docker-compose | ||
|
||
WORKDIR /app | ||
|
||
ADD runtests/requirements.txt /app/ | ||
|
||
USER app | ||
|
||
ENV PATH /home/app/venv/bin:${PATH} | ||
|
||
RUN python3 -m venv ~/venv && \ | ||
pip install -r /app/requirements.txt | ||
|
||
ENV DJANGO_SETTINGS_MODULE settings | ||
|
||
# *WARNING*: DO NOT "ADD . /app" because it would include the current settings in the base image, which is uploaded by | ||
# CI to docker hub; Since the settings currently include secrets, this would leak our credentials! | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT ["/app/manage.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
except: | ||
pass | ||
|
||
__version__ = '0.9.0' | ||
__version__ = '0.10.0' | ||
__author__ = 'Asif Saif Uddin, Justin Quick <[email protected]>' | ||
default_app_config = 'actstream.apps.ActstreamConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.