]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
improve github test workflows
authorFederico Caselli <cfederico87@gmail.com>
Tue, 7 Feb 2023 21:32:47 +0000 (22:32 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 7 Feb 2023 21:37:49 +0000 (22:37 +0100)
Change-Id: Id0c8eb9c574c44365f6b8bca93b562dea5c8f9eb

.github/workflows/run-on-pr.yaml
.github/workflows/run-test.yaml

index 8c7f2715fff822cabe1047740bebe724fe0fe69a..40ed73eeb1b287ed19e31d7e3ea11ea8ee17a981 100644 (file)
@@ -25,46 +25,13 @@ jobs:
         os:
           - "ubuntu-latest"
         python-version:
-          - "3.10"
+          - "3.11"
         build-type:
           - "cext"
           - "nocext"
         architecture:
           - x64
       # abort all jobs as soon as one fails
-      fail-fast: true
-
-    # steps to run in each job. Some are github actions, others run shell commands
-    steps:
-      - name: Checkout repo
-        uses: actions/checkout@v3
-
-      - name: Set up python
-        uses: actions/setup-python@v4
-        with:
-          python-version: ${{ matrix.python-version }}
-          architecture: ${{ matrix.architecture }}
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install --upgrade tox setuptools
-          pip list
-
-      - name: Run tests
-        run: tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}
-
-  run-mypy:
-    name: mypy-${{ matrix.python-version }}
-    runs-on: ${{ matrix.os }}
-    strategy:
-      # run this job using this matrix, excluding some combinations below.
-      matrix:
-        os:
-          - "ubuntu-latest"
-        python-version:
-          - "3.10"
-
       fail-fast: false
 
     # steps to run in each job. Some are github actions, others run shell commands
@@ -85,22 +52,24 @@ jobs:
           pip list
 
       - name: Run tests
-        run: tox -e mypy ${{ matrix.pytest-args }}
+        run: tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}
 
-  run-lint:
-    name: lint-${{ matrix.python-version }}
+  run-tox:
+    name: ${{ matrix.tox-env }}-${{ matrix.python-version }}
     runs-on: ${{ matrix.os }}
     strategy:
-      # run this job using this matrix, excluding some combinations below.
       matrix:
         os:
           - "ubuntu-latest"
         python-version:
-          - "3.10"
+          - "3.11"
+        tox-env:
+          - mypy
+          - lint
+          - pep484
 
       fail-fast: false
 
-    # steps to run in each job. Some are github actions, others run shell commands
     steps:
       - name: Checkout repo
         uses: actions/checkout@v3
@@ -117,36 +86,5 @@ jobs:
           pip install --upgrade tox setuptools
           pip list
 
-      - name: Run tests
-        run: tox -e lint
-
-  # Arm emulation is quite slow (~20min) so for now just run it when merging to main
-  # run-test-arm64:
-  #   name: ${{ matrix.python-version }}-${{ matrix.build-type }}-arm64-ubuntu-latest
-  #   runs-on: ubuntu-latest
-  #   strategy:
-  #     matrix:
-  #       python-version:
-  #         - "3.9"
-  #       build-type:
-  #         - "cext"
-  #         - "nocext"
-  #     fail-fast: true
-
-  #   steps:
-  #     - name: Checkout repo
-  #       uses: actions/checkout@v3
-
-  #     - name: Set up emulation
-  #       run: |
-  #         docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
-
-  #     - name: Run tests
-  #       uses: docker://arm64v8/python:3.8-buster
-  #       with:
-  #         args: |
-  #               bash -c "
-  #               python -m pip install --upgrade pip &&
-  #               pip install --upgrade tox setuptools &&
-  #               pip list &&
-  #               tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}"
+      - name: Run tox
+        run: tox -e ${{ matrix.tox-env }} ${{ matrix.pytest-args }}
index a8141c85451074e02c1c9c1e807d9e74dc27365f..938c7c55dde06459af35f52349938914db4beab9 100644 (file)
@@ -132,8 +132,8 @@ jobs:
             tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}
             "
 
-  run-mypy:
-    name: mypy-${{ matrix.python-version }}
+  run-tox:
+    name: ${{ matrix.tox-env }}-${{ matrix.python-version }}
     runs-on: ${{ matrix.os }}
     strategy:
       # run this job using this matrix, excluding some combinations below.
@@ -141,9 +141,28 @@ jobs:
         os:
           - "ubuntu-latest"
         python-version:
+          - "3.8"
           - "3.9"
           - "3.10"
           - "3.11"
+        tox-env:
+          - mypy
+          - lint
+          - pep484
+        
+        exclude:
+          # run lint only on 3.11
+          - tox-env: lint
+            python-version: "3.8"
+          - tox-env: lint
+            python-version: "3.9"
+          - tox-env: lint
+            python-version: "3.10"
+          # run pep484 only on 3.10+
+          - tox-env: pep484
+            python-version: "3.8"
+          - tox-env: pep484
+            python-version: "3.9"
 
       fail-fast: false
 
@@ -164,72 +183,5 @@ jobs:
           pip install --upgrade tox setuptools
           pip list
 
-      - name: Run tests
-        run: tox -e mypy ${{ matrix.pytest-args }}
-
-  run-lint:
-    name: lint-${{ matrix.python-version }}
-    runs-on: ${{ matrix.os }}
-    strategy:
-      # run this job using this matrix, excluding some combinations below.
-      matrix:
-        os:
-          - "ubuntu-latest"
-        python-version:
-          - "3.11"
-
-      fail-fast: false
-
-    # steps to run in each job. Some are github actions, others run shell commands
-    steps:
-      - name: Checkout repo
-        uses: actions/checkout@v3
-
-      - name: Set up python
-        uses: actions/setup-python@v4
-        with:
-          python-version: ${{ matrix.python-version }}
-          architecture: ${{ matrix.architecture }}
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install --upgrade tox setuptools
-          pip list
-
-      - name: Run tests
-        run: tox -e lint
-
-  run-pep484:
-    name: pep484-${{ matrix.python-version }}
-    runs-on: ${{ matrix.os }}
-    strategy:
-      # run this job using this matrix, excluding some combinations below.
-      matrix:
-        os:
-          - "ubuntu-latest"
-        python-version:
-          - "3.10"
-          - "3.11"
-
-      fail-fast: false
-
-    # steps to run in each job. Some are github actions, others run shell commands
-    steps:
-      - name: Checkout repo
-        uses: actions/checkout@v3
-
-      - name: Set up python
-        uses: actions/setup-python@v4
-        with:
-          python-version: ${{ matrix.python-version }}
-          architecture: ${{ matrix.architecture }}
-
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install --upgrade tox setuptools
-          pip list
-
-      - name: Run tests
-        run: tox -e pep484
+      - name: Run tox
+        run: tox -e ${{ matrix.tox-env }} ${{ matrix.pytest-args }}