]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
ci: separate source and binary package workflows
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 20 Dec 2022 15:25:14 +0000 (15:25 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 20 Dec 2022 15:58:39 +0000 (15:58 +0000)
.github/workflows/lint.yml
.github/workflows/packages-bin.yml [moved from .github/workflows/packages.yml with 74% similarity]
.github/workflows/packages-src.yml [new file with mode: 0644]

index 45275510023f963fc4a3cbcac9143791ff3f72ec..216032636f97c924b5254006793c3d91a87c6969 100644 (file)
@@ -15,6 +15,7 @@ concurrency:
 jobs:
   lint:
     runs-on: ubuntu-latest
+    if: true
 
     steps:
       - uses: actions/checkout@v3
similarity index 74%
rename from .github/workflows/packages.yml
rename to .github/workflows/packages-bin.yml
index 18a2817c867156d63ff0859b92e0bd2921f4c01d..f8283e95d56d094661819f2e5730e5615a7b1ce3 100644 (file)
@@ -1,4 +1,4 @@
-name: Build packages
+name: Build binary packages
 
 on:
   workflow_dispatch:
@@ -7,77 +7,6 @@ on:
 
 jobs:
 
-  sdist:  # {{{
-    runs-on: ubuntu-latest
-    if: true
-
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - {package: psycopg, format: sdist, impl: python}
-          - {package: psycopg, format: wheel, impl: python}
-          - {package: psycopg_c, format: sdist, impl: c}
-
-    steps:
-      - uses: actions/checkout@v3
-
-      - uses: actions/setup-python@v4
-        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 package and test requirements
-        run: |-
-          pip install `ls dist/*`[test]
-          pip install ./psycopg_pool
-        if: ${{ matrix.package == 'psycopg' }}
-
-      - name: Install the C package and test requirements
-        run: |-
-          pip install dist/*
-          pip install ./psycopg[test]
-          pip install ./psycopg_pool
-        if: ${{ matrix.package == 'psycopg_c' }}
-
-      - name: Test the sdist package
-        run: pytest -m 'not slow and not flakey' --color yes
-        env:
-          PSYCOPG_IMPL: ${{ matrix.impl }}
-          PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
-          PGPASSWORD: password
-
-      - uses: actions/upload-artifact@v3
-        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
-
-
-  # }}}
-
   linux:  # {{{
     runs-on: ubuntu-latest
     if: true
diff --git a/.github/workflows/packages-src.yml b/.github/workflows/packages-src.yml
new file mode 100644 (file)
index 0000000..1a9534f
--- /dev/null
@@ -0,0 +1,76 @@
+name: Build source packages
+
+on:
+  workflow_dispatch:
+  schedule:
+    - cron: '37 6 * * sun'
+
+jobs:
+
+  sdist:
+    runs-on: ubuntu-latest
+    if: true
+
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - {package: psycopg, format: sdist, impl: python}
+          - {package: psycopg, format: wheel, impl: python}
+          - {package: psycopg_c, format: sdist, impl: c}
+
+    steps:
+      - uses: actions/checkout@v3
+
+      - uses: actions/setup-python@v4
+        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 package and test requirements
+        run: |-
+          pip install `ls dist/*`[test]
+          pip install ./psycopg_pool
+        if: ${{ matrix.package == 'psycopg' }}
+
+      - name: Install the C package and test requirements
+        run: |-
+          pip install dist/*
+          pip install ./psycopg[test]
+          pip install ./psycopg_pool
+        if: ${{ matrix.package == 'psycopg_c' }}
+
+      - name: Test the sdist package
+        run: pytest -m 'not slow and not flakey' --color yes
+        env:
+          PSYCOPG_IMPL: ${{ matrix.impl }}
+          PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
+          PGPASSWORD: password
+
+      - uses: actions/upload-artifact@v3
+        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