Skip to content

Commit

Permalink
test: Run the docker processes that people need to be able to run
Browse files Browse the repository at this point in the history
  • Loading branch information
marksweb committed Jan 13, 2024
1 parent d86c518 commit d48615d
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker test suite

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
pytest:
name: Docker test build
# List of supported runners:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Pre-build container images
run: |
docker network create djangocmsnet
docker compose build --force-rm
- name: Run the containers
run: |
docker compose build web
docker compose up database_default -d
docker compose run web python manage.py migrate
docker compose up -d
- name: Wait for 5 seconds
run: sleep 5s
shell: bash

- name: 'debug: Display state and logs'
if: always()
run: |
docker compose ps
docker compose logs web
docker compose logs database_default
- name: Execute django check
run: docker compose exec -w /app web python manage.py check --deploy

- name: Execute test suite
run: docker compose exec -w /app web python manage.py test

- name: Terminate all components
if: always()
run: docker compose down -v

0 comments on commit d48615d

Please sign in to comment.