]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Separate pool packages building into a different workflow
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 3 Jan 2022 15:37:37 +0000 (16:37 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 3 Jan 2022 15:39:38 +0000 (16:39 +0100)
Psycopg and pool releases are separate.

.github/workflows/packages-pool.yml [new file with mode: 0644]
.github/workflows/packages.yml

diff --git a/.github/workflows/packages-pool.yml b/.github/workflows/packages-pool.yml
new file mode 100644 (file)
index 0000000..be9cc26
--- /dev/null
@@ -0,0 +1,66 @@
+name: Build pool packages
+
+on:
+  workflow_dispatch:
+  schedule:
+    - cron: '28 6 * * sun'
+
+jobs:
+
+  sdist:
+    runs-on: ubuntu-20.04
+
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - {package: psycopg_pool, format: sdist, impl: python}
+          - {package: psycopg_pool, format: wheel, impl: python}
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - uses: actions/setup-python@v2
+        with:
+          python-version: 3.9
+
+      - name: Create the sdist packages
+        run: |-
+          python ${{ matrix.package }}/setup.py sdist -d `pwd`/dist/
+        if: ${{ matrix.format == 'sdist' }}
+
+      - name: Create the wheel packages
+        run: |-
+          pip install wheel
+          python ${{ matrix.package }}/setup.py bdist_wheel -d `pwd`/dist/
+        if: ${{ matrix.format == 'wheel' }}
+
+      - name: Install the Python pool package and test requirements
+        run: |-
+          pip install dist/*
+          pip install -e ./psycopg[test]
+
+      - name: Test the sdist package
+        run: pytest -m 'not slow' --color yes
+        env:
+          PSYCOPG_IMPL: ${{ matrix.impl }}
+          PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
+          PGPASSWORD: password
+
+      - uses: actions/upload-artifact@v2
+        with:
+          path: ./dist/*
+
+    services:
+      postgresql:
+        image: postgres:14
+        env:
+          POSTGRES_PASSWORD: password
+        ports:
+          - 5432:5432
+        # Set health checks to wait until postgres has started
+        options: >-
+          --health-cmd pg_isready
+          --health-interval 10s
+          --health-timeout 5s
+          --health-retries 5
index 76bbecce7c35bc90c2b9da3a4e005cf1393ef221..fc5c2c3744a9b57f59461649b46205ce2e32bf3a 100644 (file)
@@ -17,8 +17,6 @@ jobs:
           - {package: psycopg, format: sdist, impl: python}
           - {package: psycopg, format: wheel, impl: python}
           - {package: psycopg_c, format: sdist, impl: c}
-          - {package: psycopg_pool, format: sdist, impl: python}
-          - {package: psycopg_pool, format: wheel, impl: python}
 
     steps:
       - uses: actions/checkout@v2
@@ -28,7 +26,7 @@ jobs:
           python-version: 3.9
 
       - name: Create the sdist packages
-        run: >-
+        run: |-
           python ${{ matrix.package }}/setup.py sdist -d `pwd`/dist/
         if: ${{ matrix.format == 'sdist' }}
 
@@ -51,12 +49,6 @@ jobs:
           pip install -e ./psycopg_pool
         if: ${{ matrix.package == 'psycopg_c' }}
 
-      - name: Install the Python pool package and test requirements
-        run: |-
-          pip install dist/*
-          pip install -e ./psycopg[test]
-        if: ${{ matrix.package == 'psycopg_pool' }}
-
       - name: Test the sdist package
         run: pytest -m 'not slow' --color yes
         env: