Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from alisaifee/github-actions
Switch CI from travis to github actions
- Loading branch information
Showing
21 changed files
with
208 additions
and
4,904 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
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 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [2.7, pypy2, 3.5, 3.7, 3.8, pypy3] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install -r requirements/ci.txt | ||
- name: Start services | ||
run: | | ||
make setup-test-backends | ||
- name: Tests | ||
run: | | ||
nosetests tests --with-cov -v --with-timer --timer-top-n 10 | ||
- name: Coverage | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
run: | | ||
coveralls | ||
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 |
---|---|---|
|
@@ -12,5 +12,5 @@ htmlcov | |
redis-git | ||
.python-version | ||
# gae test files | ||
google-cloud-sdk/ | ||
google_appengine | ||
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,57 @@ | ||
SHELL = bash | ||
ifneq ("$(wildcard ./google_appengine/VERSION)","") | ||
GAE_INSTALLED = 1 | ||
else | ||
GAE_INSTALLED = 0 | ||
endif | ||
|
||
HOST_OS = $(shell uname -s) | ||
ifeq ("$(HOST_OS)", "Darwin") | ||
HOST_IP = $(shell ipconfig getifaddr en0) | ||
OS_HACKS = osx-hacks | ||
else | ||
HOST_IP = $(shell hostname -I | awk '{print $$1}') | ||
endif | ||
|
||
PY_VERSION =$(shell python -c "import sys;print('.'.join(str(k) for k in sys.version_info[0:2]))") | ||
|
||
redis-uds-start: | ||
redis-server --port 0 --unixsocket /tmp/limits.redis.sock --daemonize yes --pidfile /tmp/redis_unix-domain-socket.pid | ||
|
||
redis-uds-stop: | ||
[ -e /tmp/redis_unix-domain-socket.pid ] && kill -9 `cat /tmp/redis_unix-domain-socket.pid` || true | ||
|
||
|
||
memcached-uds-start: | ||
memcached -d -s /tmp/limits.memcached.sock -P /tmp/limits.memcached.uds.pid | ||
|
||
memcached-uds-stop: | ||
[ -e /tmp/limits.memcached.uds.pid ] && kill `cat /tmp/limits.memcached.uds.pid` || true | ||
rm -rf /tmp/limits.memcached.*.pid | ||
|
||
memcached-gae-install: | ||
ifeq ($(PY_VERSION),2.7) | ||
ifeq ($(GAE_INSTALLED),0) | ||
wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.91.zip -P /var/tmp/ | ||
rm -rf google_appengine | ||
unzip -qu /var/tmp/google_appengine_1.9.91.zip -d . | ||
else | ||
echo "GAE SDK already setup" | ||
endif | ||
ln -sf google_appengine/google google | ||
endif | ||
|
||
docker-down: | ||
docker-compose down --remove-orphans | ||
|
||
docker-up: docker-down | ||
HOST_OS=$(HOST_OS) HOST_IP=$(HOST_IP) docker-compose up -d | ||
docker exec -i limits_redis-cluster-5_1 bash -c "echo yes | redis-cli --cluster create --cluster-replicas 1 $(HOST_IP):{7000..7005}" | ||
|
||
osx-hacks: redis-uds-stop memcached-uds-stop redis-uds-start memcached-uds-start | ||
|
||
setup-test-backends: $(OS_HACKS) memcached-gae-install docker-up | ||
|
||
tests: setup-test-backends | ||
nosetests tests --with-cov -v --with-timer --timer-top-n 10 | ||
.PHONY: test |
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
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
version: '3.2' | ||
|
||
services: | ||
# memcached | ||
memcached-1: | ||
image: memcached | ||
command: -p 22122 | ||
ports: | ||
- 22122:22122 | ||
memcached-2: | ||
image: memcached | ||
command: -p 22123 | ||
ports: | ||
- 22123:22123 | ||
memcached-uds: | ||
image: memcached | ||
command: sh -c "test ${HOST_OS} == \"Darwin\" && exit || memcached -s /sockets/limits.memcached.sock -a 777" | ||
volumes: | ||
- type: bind | ||
source: /tmp/ | ||
target: /sockets/ | ||
# redis sentinel | ||
redis-sentinel-master: | ||
image: redis | ||
command: redis-server --port 6380 | ||
ports: | ||
- '6380:6380' | ||
redis-sentinel-slave: | ||
image: redis | ||
depends_on: [redis-sentinel-master] | ||
command: redis-server --port 6381 --slaveof ${HOST_IP} 6380 --slave-announce-ip ${HOST_IP} | ||
ports: | ||
- '6381:6381' | ||
redis-sentinel: | ||
image: 'bitnami/redis-sentinel:latest' | ||
depends_on: [redis-sentinel-slave] | ||
environment: | ||
- REDIS_MASTER_SET=localhost-redis-sentinel | ||
- REDIS_MASTER_HOST=${HOST_IP} | ||
- REDIS_MASTER_PORT_NUMBER=6380 | ||
ports: | ||
- '26379:26379' | ||
# cluster | ||
redis-cluster-0: | ||
image: redis | ||
command: redis-server --port 7000 --protected-mode no --cluster-enabled yes --loglevel verbose --cluster-announce-ip ${HOST_IP} | ||
ports: | ||
- '7000:7000' | ||
- '17000:17000' | ||
redis-cluster-1: | ||
image: redis | ||
command: redis-server --port 7001 --protected-mode no --cluster-enabled yes --loglevel verbose --cluster-announce-ip ${HOST_IP} | ||
ports: | ||
- '7001:7001' | ||
- '17001:17001' | ||
redis-cluster-2: | ||
image: redis | ||
command: redis-server --port 7002 --protected-mode no --cluster-enabled yes --loglevel verbose --cluster-announce-ip ${HOST_IP} | ||
ports: | ||
- '7002:7002' | ||
- '17002:17002' | ||
redis-cluster-3: | ||
image: redis | ||
command: redis-server --port 7003 --protected-mode no --cluster-enabled yes --loglevel verbose --cluster-announce-ip ${HOST_IP} | ||
ports: | ||
- '7003:7003' | ||
- '17003:17003' | ||
redis-cluster-4: | ||
image: redis | ||
command: redis-server --port 7004 --protected-mode no --cluster-enabled yes --loglevel verbose --cluster-announce-ip ${HOST_IP} | ||
ports: | ||
- '7004:7004' | ||
- '17004:17004' | ||
redis-cluster-5: | ||
image: redis | ||
command: redis-server --port 7005 --protected-mode no --cluster-enabled yes --loglevel verbose --cluster-announce-ip ${HOST_IP} | ||
ports: | ||
- '7005:7005' | ||
- '17005:17005' | ||
redis-basic: | ||
image: redis | ||
command: redis-server --port 7379 | ||
ports: | ||
- '7379:7379' | ||
redis-auth: | ||
image: redis | ||
command: redis-server --port 7389 --requirepass sekret | ||
ports: | ||
- '7389:7389' | ||
redis-uds: | ||
image: redis | ||
command: sh -c "test ${HOST_OS} = \"Darwin\" && exit || redis-server --port 0 --unixsocket /sockets/limits.redis.sock --unixsocketperm 777" | ||
volumes: | ||
- type: bind | ||
source: /tmp/ | ||
target: /sockets/ |
Oops, something went wrong.