diff --git a/.github/workflows/accessibility-test.yml b/.github/workflows/accessibility-test.yml new file mode 100644 index 00000000..c4eaf2b7 --- /dev/null +++ b/.github/workflows/accessibility-test.yml @@ -0,0 +1,38 @@ +name: Run accessibility tests +on: + push: + branches: + - '*' + schedule: + - cron: '0 0 * * *' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Download latest DB / media dump + env: + DEBIAN_FRONTEND: noninteractive + AWS_ACCESS_KEY_ID: ${{ secrets.DO_SPACES_DEV_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_SPACES_DEV_ACCESS_KEY }} + run: | + aws s3 cp --quiet --endpoint-url=${{ secrets.DO_SPACES_DEV_ENDPOINT }} s3://wagtail/ietfa.torchbox.latest.gz ietfa.torchbox.latest.gz + aws s3 cp --quiet --endpoint-url=${{ secrets.DO_SPACES_DEV_ENDPOINT }} s3://wagtail/media.tgz media.tgz + + - name: Unarchive media files + run: | + mkdir -p ./media + tar -xzf media.tgz -C media + + - name: Docker Compose up + run: docker compose up --build -d + + - name: Wait for services to be up + run: sleep 10 + + - name: Run accessibility tests + run: docker exec www-frontend-1 sh -c 'yarn test $APP_SERVER_URL' diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 2fab7562..82cc66a8 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -3,7 +3,6 @@ on: push: branches: - main - - feat/modern-footer pull_request: branches: - '*' @@ -14,10 +13,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker build app-test - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . file: docker/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 166521ad..1fc897d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.7" - services: application: restart: on-failure @@ -27,6 +25,10 @@ services: target: frontend volumes: - ".:/app" + environment: + APP_SERVER_URL: "http://application:8000" + depends_on: + - application database: restart: on-failure