From d5a1b6fe409713ee76a354e4e120007890c83da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:45:23 +0100 Subject: [PATCH] ci: Run coverage tests in parallel (#399) Instead of re-running the same tests again after the checks have finished, run the coverage tests in parallel with the required check. Also use the latest supported python version for the latter, instead of running the tests twice with the minimum py version. --- .github/workflows/pull-request.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index dedaf754..3c979c79 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -14,20 +14,19 @@ on: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + # A constant location for the uv cache UV_CACHE_DIR: /tmp/.uv-cache jobs: check: - name: Check Python + name: Check Python (3.10) runs-on: ubuntu-latest - - strategy: - matrix: - python-version: ['3.10'] + env: + PYTHON_VERSION: '3.10' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.5 - name: install-llvm @@ -38,7 +37,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ env.PYTHON_VERSION }} - name: Restore uv cache uses: actions/cache@v4 with: @@ -75,10 +74,12 @@ jobs: - name: Minimize uv cache run: uv cache prune --ci - coverage: - if: github.event_name != 'merge_group' - needs: check + test-coverage: + name: Check Python (3.12) with coverage runs-on: ubuntu-latest + env: + PYTHON_VERSION: '3.12' + steps: - uses: actions/checkout@v4 - name: Run sccache-cache @@ -89,7 +90,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ env.PYTHON_VERSION }} - name: Restore uv cache uses: actions/cache@v4 with: