Bump django from 3.2.24 to 3.2.25 #257
Workflow file for this run
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
name: Python CI | |
on: | |
push: | |
pull_request: | |
release: | |
types: [ released ] | |
jobs: | |
test-app: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
services: | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
postgres: | |
image: postgres:10 | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Setup and run ganache | |
run: | | |
docker run --detach --publish 8545:8545 --network-alias ganache -e DOCKER=true trufflesuite/ganache-cli:latest --defaultBalanceEther 10000 --gasLimit 10000000 -a 30 --noVMErrorsOnRPCResponse --chainId 1337 --networkId 1337 -d | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-test.txt') }}-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
pip install wheel | |
pip install -r requirements-test.txt coveralls | |
env: | |
PIP_USE_MIRRORS: true | |
- name: Run tests and coverage | |
run: | | |
python manage.py check | |
python manage.py makemigrations --check --dry-run | |
coverage run --source=$SOURCE_FOLDER -m py.test -rxXs | |
env: | |
SOURCE_FOLDER: safe_notification_service | |
DJANGO_SETTINGS_MODULE: config.settings.test | |
DATABASE_URL: psql://postgres:postgres@localhost/postgres | |
ETHEREUM_NODE_URL: http://localhost:8545 | |
ETHEREUM_TRACING_NODE_URL: http://localhost:8545 | |
REDIS_URL: redis://localhost:6379/0 | |
CELERY_BROKER_URL: redis://localhost:6379/0 | |
ETHEREUM_MAINNET_NODE: ${{ secrets.ETHEREUM_MAINNET_NODE }} | |
COINMARKETCAP_API_TOKEN: ${{ secrets.COINMARKETCAP_API_TOKEN }} | |
- name: Send results to coveralls | |
continue-on-error: true # Ignore coveralls problems | |
if: ${{ env.COVERALLS_REPO_TOKEN }} | |
run: | | |
coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for coveralls | |
docker-deploy: | |
runs-on: ubuntu-latest | |
needs: test-app | |
if: github.event_name == 'release' && github.event.action == 'released' | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Cache Docker layers | |
uses: actions/[email protected] | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Set tag (release) | |
# Set the tag versions as Docker tag if it is a release event | |
if: github.event_name == 'release' && github.event.action == 'released' | |
run: echo "DOCKER_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
file: docker/web/Dockerfile | |
tags: safeglobal/safe-notification-service:${{ env.DOCKER_TAG }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
- # Temp fix | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |