Skip to content

chore(deps): bump sentry-sdk from 1.14.0 to 2.0.1 #83

chore(deps): bump sentry-sdk from 1.14.0 to 2.0.1

chore(deps): bump sentry-sdk from 1.14.0 to 2.0.1 #83

Workflow file for this run

name: docker build and test
on:
push:
branches:
- '**'
pull_request:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
strategy:
fail-fast: false
matrix:
tag_flags: ["--exclude-tag selenium", "--tag selenium"]
steps:
- name: Check out solr
uses: actions/checkout@v3
with:
repository: freelawproject/courtlistener-solr-server
ref: main
path: courtlistener-solr-server
- name: Set up solr permissions
run: |
cd courtlistener-solr-server
sudo chown -R :1024 data
sudo chown -R :1024 solr
sudo find data -type d -exec chmod g+s {} \;
sudo find solr -type d -exec chmod g+s {} \;
sudo find data -type d -exec chmod 775 {} \;
sudo find solr -type d -exec chmod 775 {} \;
sudo find data -type f -exec chmod 664 {} \;
sudo find solr -type f -exec chmod 664 {} \;
- name: Check out CourtListener
uses: actions/checkout@v3
with:
path: courtlistener
- name: Create the .env settings file
working-directory: courtlistener/
run: cp .env.example .env.dev
- name: Update .env.dev file
working-directory: courtlistener/
run: |
echo 'SECRET_KEY=Verbal-Kint-is-Keyser-Soze' >> .env.dev
echo 'ALLOWED_HOSTS=*' >> .env.dev
- name: Echo github actor name for debugging
run: echo ${{ github.actor }}
# Build and cache docker images so tests are always run on the latest
# dependencies
- name: Set up docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Cache Docker celery layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-celery
key: ${{ runner.os }}-buildx-celery-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-celery-
- name: Build latest docker django image
uses: docker/build-push-action@v4
with:
file: docker/django/Dockerfile
push: true
target: web-dev
build-args: |
BUILD_ENV=dev
tags: localhost:5000/freelawproject/courtlistener:latest-web-dev-${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Build latest docker celery image
uses: docker/build-push-action@v4
with:
file: docker/django/Dockerfile
push: true
target: celery
build-args: |
BUILD_ENV=dev
tags: localhost:5000/freelawproject/courtlistener:latest-celery-${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache-celery
cache-to: type=local,dest=/tmp/.buildx-cache-celery-new
# Docker images are ready. Start them up.
- name: Create docker network
run: docker network create -d bridge --attachable cl_net_overlay
- name: Start docker compose
working-directory: courtlistener/docker/courtlistener
run: docker-compose -f docker-compose.yml -f docker-compose.tmpfs.yml up -d
env:
CELERY_DOCKER_IMAGE: "localhost:5000/freelawproject/courtlistener:latest-celery-${{ github.sha }}"
DJANGO_DOCKER_IMAGE: "localhost:5000/freelawproject/courtlistener:latest-web-dev-${{ github.sha }}"
- name: List docker images
run: docker image ls -a --no-trunc
- name: List docker container statuses
run: docker ps -a --no-trunc
- name: Show the docker startup logs
working-directory: courtlistener/docker/courtlistener
run: docker-compose logs
# Run the checks and tests
- name: Check if migrations are missing
run: docker exec cl-django python /opt/courtlistener/manage.py makemigrations --check --dry-run
- name: Run the tests!
run: >
docker exec -e SELENIUM_DEBUG=1 -e SELENIUM_TIMEOUT=30 cl-django
python /opt/courtlistener/manage.py test
cl --verbosity=2 ${{ matrix.tag_flags }} --parallel
- name: cp selenium results from docker to host
if: failure()
run: |
# This is annoying b/c docker cp doesn't support globs. See:
# https://stackoverflow.com/q/35806102/
# https://github.com/moby/moby/issues/7710
mkdir selenium-screenshots
docker exec cl-django bash -c "mkdir /extract && mv /tmp/*-selenium.png /extract"
docker cp 'cl-django:/extract' selenium-screenshots/
- name: Save selenium screenshot as Github artifacts
uses: actions/upload-artifact@master
if: failure()
with:
name: selenium-screenshots
path: selenium-screenshots/extract
# 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
rm -rf /tmp/.buildx-cache-celery
mv /tmp/.buildx-cache-celery-new /tmp/.buildx-cache-celery
# Cancel the current workflow (tests) for pull requests (head_ref) only. See:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true