From: Federico Caselli Date: Tue, 7 Feb 2023 21:32:47 +0000 (+0100) Subject: improve github test workflows X-Git-Tag: rel_2_0_3~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33dc651030b900bad31842df927fb8454b9a75d1;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git improve github test workflows Change-Id: Id0c8eb9c574c44365f6b8bca93b562dea5c8f9eb --- diff --git a/.github/workflows/run-on-pr.yaml b/.github/workflows/run-on-pr.yaml index 8c7f2715ff..40ed73eeb1 100644 --- a/.github/workflows/run-on-pr.yaml +++ b/.github/workflows/run-on-pr.yaml @@ -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 }} diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index a8141c8545..938c7c55dd 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -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 }}