From 209013427a50d3c74dd6528db7cbd03a675f5c28 Mon Sep 17 00:00:00 2001 From: Daniel Mursa Date: Mon, 3 Feb 2025 14:02:25 +0100 Subject: [PATCH] [maykinmedia/open-api-framework#96] Add quick-start.yml --- .github/workflows/quick-start.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/quick-start.yml diff --git a/.github/workflows/quick-start.yml b/.github/workflows/quick-start.yml new file mode 100644 index 0000000..f664844 --- /dev/null +++ b/.github/workflows/quick-start.yml @@ -0,0 +1,33 @@ +name: quick-start + +on: + workflow_call: + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Start docker containers + run: docker compose up -d --build || ( docker compose logs >&2 && exit 1; ) + - name: Wait for migrations to finish + run: | + echo "Waiting for migrations to complete..." + until ! docker compose exec -T web src/manage.py showmigrations | grep -q '\[ \]'; do + echo "Migrations not finished, waiting..." + sleep 3 + done + - name: Show web-init logs + run: docker compose logs web-init + - name: Load fixtures + run: docker compose exec -T web src/manage.py loaddata demodata + - name: Create superuser + run: docker compose exec -T web src/manage.py createsuperuser --username admin --email admin@admin.nl --no-input + - name: Check main page + run: | + curl_status=$(curl -w '%{http_code}' -o /dev/null -s http://localhost:8000/) + if [[ $curl_status != 200 ]]; then + printf "Index page responds with ${curl_status} status.\r\n\r\n" >&2 + curl -i http://localhost:8000 + exit 1 + fi \ No newline at end of file