]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Unify sdist and wheel packages building
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 3 Sep 2021 22:04:17 +0000 (00:04 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 3 Sep 2021 22:24:11 +0000 (00:24 +0200)
.github/workflows/packages.yml

index 25ea195de8277ee8de6edd4268c9f925112f111a..df12fdf650b76c4a7af6da64b682678d76b41697 100644 (file)
@@ -5,19 +5,19 @@ on:
 
 jobs:
 
-  sdist:  # {{{
+  source:  # {{{
     name: Build sdist packages
     runs-on: ubuntu-20.04
-    # NOMERGE
-    if: false
 
     strategy:
       fail-fast: false
       matrix:
         include:
-          - {package: psycopg, impl: python}
-          - {package: psycopg_c, impl: c}
-          - {package: psycopg_pool, impl: python}
+          - {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
@@ -29,23 +29,30 @@ jobs:
       - 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 package and test requirements
         run: |-
-          pip install `ls dist/psycopg-*.tar.gz`[test]
+          pip install `ls dist/*`[test]
           pip install -e ./psycopg_pool
         if: ${{ matrix.package == 'psycopg' }}
 
       - name: Install the C package and test requirements
         run: |-
-          pip install dist/psycopg-c-*.tar.gz
+          pip install dist/*
           pip install -e ./psycopg[test]
           pip install -e ./psycopg_pool
         if: ${{ matrix.package == 'psycopg_c' }}
 
       - name: Install the Python pool package and test requirements
         run: |-
-          pip install dist/psycopg-pool-*.tar.gz
+          pip install dist/*
           pip install -e ./psycopg[test]
         if: ${{ matrix.package == 'psycopg_pool' }}
 
@@ -58,7 +65,7 @@ jobs:
 
       - uses: actions/upload-artifact@v2
         with:
-          path: ./dist/*.tar.gz
+          path: ./dist/*
 
     services:
       postgresql:
@@ -74,77 +81,12 @@ jobs:
           --health-timeout 5s
           --health-retries 5
 
-  # }}}
-
-
-  wheel:  # {{{
-    name: Build wheel packages
-    runs-on: ubuntu-20.04
-
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - {package: psycopg, impl: python}
-          - {package: psycopg_pool, impl: python}
-
-    steps:
-      - uses: actions/checkout@v2
-
-      - uses: actions/setup-python@v2
-        with:
-          python-version: 3.9
-
-      - name: Create the wheel packages
-        run: |-
-          pip install wheel
-          python ${{ matrix.package }}/setup.py bdist_wheel -d `pwd`/dist/
-
-      - name: Install the Python package and test requirements
-        run: |-
-          pip install `ls dist/*.whl`[test]
-          pip install -e ./psycopg_pool
-        if: ${{ matrix.package == 'psycopg' }}
-
-      - name: Install the Python pool package and test requirements
-        run: |-
-          pip install dist/*.whl
-          pip install -e ./psycopg[test]
-        if: ${{ matrix.package == 'psycopg_pool' }}
-
-      - name: Test the wheel 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/*.whl
-
-    services:
-      postgresql:
-        image: postgres:13
-        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
 
   # }}}
 
-
   linux:  # {{{
     name: Build Linux packages
     runs-on: ubuntu-20.04
-    # NOMERGE
-    if: false
 
     strategy:
       matrix:
@@ -197,14 +139,12 @@ jobs:
           --health-timeout 5s
           --health-retries 5
 
-  # }}}
 
+  # }}}
 
   macos:  # {{{
     name: Build MacOS packages
     runs-on: macos-10.15
-    # NOMERGE
-    if: false
 
     strategy:
       matrix:
@@ -236,14 +176,12 @@ jobs:
         with:
           path: ./wheelhouse/*.whl
 
-  # }}}
 
+  # }}}
 
   windows:  # {{{
     name: Build Windows packages
     runs-on: windows-2019
-    # NOMERGE
-    if: false
 
     strategy:
       matrix:
@@ -284,4 +222,5 @@ jobs:
         with:
           path: ./wheelhouse/*.whl
 
+
   # }}}