[PATCH] ci: add docker-compose tests

You-Sheng Yang vicamo at gmail.com
Fri Nov 26 13:19:07 AEDT 2021


Signed-off-by: You-Sheng Yang <vicamo at gmail.com>
---
 .github/workflows/ci.yaml                     | 34 +++++++++++++++++++
 ...docker-compose-tests-69f13bc725725754.yaml |  4 +++
 2 files changed, 38 insertions(+)
 create mode 100644 releasenotes/notes/ci-add-docker-compose-tests-69f13bc725725754.yaml

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index d2061a9..df4ade3 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -102,3 +102,37 @@ jobs:
           name: html-docs-build
           path: docs/_build/html
           retention-days: 7
+  docker-compose:
+    name: Docker Image tests
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        db: [postgres, mysql]
+    steps:
+      - name: Checkout source code
+        uses: actions/checkout at v2
+        with:
+          fetch-depth: 0
+      - name: Set up Python 3.9
+        uses: actions/setup-python at v2
+        with:
+          python-version: 3.9
+      - name: Bring up docker-compose service
+        env:
+          COMPOSE_FILE: ${{ matrix.db == 'mysql' && 'docker-compose.yml' || 'docker-compose-pg.yml' }}
+        run: |
+          docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g)
+          docker-compose up --detach
+          docker-compose run --rm web \
+              python manage.py createsuperuser \
+              --username patchwork --no-input --email test at example.com
+          { echo patchwork; echo patchwork; } | \
+              docker-compose run --rm web \
+              python manage.py changepassword patchwork
+          docker-compose ps
+      - name: Test client access (git-pw)
+        run: |
+          python -m pip install git-pw
+          git pw --debug \
+              --server http://localhost:8000/api/1.2 --project patchwork \
+              --username patchwork --password patchwork series list
diff --git a/releasenotes/notes/ci-add-docker-compose-tests-69f13bc725725754.yaml b/releasenotes/notes/ci-add-docker-compose-tests-69f13bc725725754.yaml
new file mode 100644
index 0000000..2a24c99
--- /dev/null
+++ b/releasenotes/notes/ci-add-docker-compose-tests-69f13bc725725754.yaml
@@ -0,0 +1,4 @@
+---
+other:
+  - |
+    Add GitHub Actions for both mysql/postgres docker-compose.yml.
-- 
2.32.0



More information about the Patchwork mailing list