From patchwork Sat Nov 27 09:40:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1560703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WBtNsepU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J1RS213wwz9sR4 for ; Sat, 27 Nov 2021 20:40:32 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4J1RRs4kqpz3c6j for ; Sat, 27 Nov 2021 20:40:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WBtNsepU; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::431; helo=mail-pf1-x431.google.com; envelope-from=vicamo@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WBtNsepU; dkim-atps=neutral Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4J1RRm6vhLz2yZ2 for ; Sat, 27 Nov 2021 20:40:20 +1100 (AEDT) Received: by mail-pf1-x431.google.com with SMTP id r130so11282126pfc.1 for ; Sat, 27 Nov 2021 01:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=h+qIk81cfWJgc40GQJv8U8PdiN5tNpjL5SOB28rEnCE=; b=WBtNsepUSoyFiwdWlm57KIQTfjUVZDSKuiMcNSCq1zddmle2BOYqXpWhwetptjCMBG V/43Kc09q1iWkKqGIXKIFpMFE8Nlg7vsAZ/6muowWCf1KkWTszalUDvaMxVzFkE8qR2e EcEtcxmqBSVBn1Fh/uQGIs8gxY0iQUxisjwyGPW1Xdm54lEtX/d3d2HC5zbxyKEw+Smb 7QocyVYnWiav2WhjgQUU+HG2DHJk1WG7fsKvpIe9dC8bvHxsrRiMnvcSIE44zbHKCaV/ qkP9WN6gJKqubDlfhfcvKVjKCGWTHv82B+ns38fRFpR1MAwRwSa7Lw+kwghj1+FySoLh ndwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=h+qIk81cfWJgc40GQJv8U8PdiN5tNpjL5SOB28rEnCE=; b=PZViFG4p+foBKisAJcZStJVHdmDbqpRiEjJsTfoRsGQzDkEINKSn2uorPKmEVWJiZp q4c+x/EmkPNI+umYgFQu6RaOKomqXwcxWX4zKfoIhDaRm7s84Iz1WNOhoiYvjMLvuNyF jpP1+kgxqFFJaVXuPQUpvFlw+Zugp5OO+Yo4Gm0tQSQ9okCK2Tj2oM06gGy8jS0YyXLK FYmbEJcGoIBKROpVSdBw14TU7xm8w5bt6h10kkexi73xuaRre9QuOj1eDbZo4usVCq5e dwRA0W3cpKbYh4FSqNziTkLXaFo94Dv1CwHMmBvXEM9I79ypduSY0ikkT+F5R2cbQ5wv Z+2g== X-Gm-Message-State: AOAM531LHHC8CTNhPsL15PT7KvckvH+K36sDbGYsDcEobFxub2fRrE79 A2TuRBEV4o71x7XaDdod1+pF8m2D95E= X-Google-Smtp-Source: ABdhPJxzVpKbLiOhjYfxKm9FYn14niOOtmc1WhZs778Rqr8MvLC90HOHuRKSOCrPdjVko8mNjauRpw== X-Received: by 2002:a05:6a00:1945:b0:44c:a955:35ea with SMTP id s5-20020a056a00194500b0044ca95535eamr25907609pfk.85.1638006017260; Sat, 27 Nov 2021 01:40:17 -0800 (PST) Received: from localhost (218-173-138-124.dynamic-ip.hinet.net. [218.173.138.124]) by smtp.gmail.com with ESMTPSA id w1sm9659837pfg.11.2021.11.27.01.40.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 01:40:16 -0800 (PST) From: You-Sheng Yang To: patchwork@lists.ozlabs.org Subject: [PATCH v2] ci: add docker-compose tests Date: Sat, 27 Nov 2021 17:40:15 +0800 Message-Id: <20211127094015.2953725-1-vicamo@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" v2: fix intermittent error. Signed-off-by: You-Sheng Yang --- .github/workflows/ci.yaml | 46 +++++++++++++++++++ ...docker-compose-tests-69f13bc725725754.yaml | 4 ++ 2 files changed, 50 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..f4a33b3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -102,3 +102,49 @@ 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@v2 + with: + fetch-depth: 0 + - name: Set up Python 3.9 + uses: actions/setup-python@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 + + for count in $(seq 50); do \ + if curl --fail --silent "http://localhost:8000"; then \ + break; \ + fi; \ + sleep 1; echo -n .; \ + done + echo + + docker-compose exec -T web \ + python manage.py createsuperuser \ + --username patchwork --no-input --email test@example.com + { echo patchwork; echo patchwork; } | \ + docker-compose exec -T 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 + - name: Dump container logs + if: ${{ always() }} + run: docker-compose logs --no-color --timestamps 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.