Skip to content

Conductor

Conductor #721

name: Run Image Processing Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
tests:
name: run tests in docker image
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
COMPOSE_FILE: tests/docker-compose.yaml
steps:
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
- name: checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: log into github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: cleanup
run: |
# try to save HDD space on the runner by removing some unneeded stuff
# ref: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# A NOTE ABOUT DOCKER IMAGES
# Because they don't change with every pull request, we've stopped
# building them in the github actions. In pratice, they were
# getting rebuilt all the time, which was slowing things down.
#
# Now, these actions depend on all the docker images having been
# pre-built and stored on the github container archive. Look at
# tests/docker-compose.yaml; there, you can see what the various
# image names are expected to be.
#
# For building and pushing these docker images, see "Running tests
# on github actions" in the "Testing" section of the code documentation.
#
# If we ever want to go back to building the docker images in
# all of the workflow files, the code is below. However, you
# should make sure that all the things under "set" in the "bake"
# section are up to date with whats in tests/docker-compose.yaml
# - name: setup docker buildx
# uses: docker/setup-buildx-action@v3
# with:
# driver: docker-container
# - name: bake
# uses: docker/bake-action@v5
# with:
# workdir: tests
# load: true
# files: docker-compose.yaml
# set: |
# archive.tags=ghcr.io/${{ github.repository_owner }}/archive
# archive.cache-from=type=gha,scope=cached-archive
# archive.cache-to=type=gha,scope=cached-archive,mode=max
# postgres.tags=ghcr.io/${{ github.repository_owner }}/postgres
# postgres.cache-from=type=gha,scope=cached-postgres
# postgres.cache-to=type=gha,scope=cached-postgres,mode=max
# setuptables.tags=ghcr.io/${{ github.repository_owner }}/runtests
# setuptables.cache-from=type=gha,scope=cached-seechange
# setuptables.cache-to=type=gha,scope=cached-seechange,mode=max
# conductor.tags=ghcr.io/${{ github.repository_owner }}/conductor
# conductor.cache-from=type=gha,scipe=cached-conductor
# conductor.cache-to=type=gha,scope=cached-conductor,mode=max
# webap.tags=ghcr.io/${{ github.repository_owner }}/seechange-webap
# webap.cache-from=type=gha,scipe=cached-seechange-webap
# webap.cache-to=type=gha,scope=cached-seechange-webap,mode=max
# runtests.tags=ghcr.io/${{ github.repository_owner }}/runtests
# runtests.cache-from=type=gha,scope=cached-seechange
# runtests.cache-to=type=gha,scope=cached-seechange,mode=max
# shell.tags=ghcr.io/${{ github.repository_owner }}/runtests
# shell.cache-from=type=gha,scope=cached-seechange
# shell.cache-to=type=gha,scope=cached-seechange,mode=max
- name: pull images
run: |
docker compose pull archive postgres conductor mailhog webap runtests
- name: run test
run: |
shopt -s nullglob
TEST_SUBFOLDER=tests/improc docker compose run -e SKIP_BIG_MEMORY=1 runtests