From 452f24351fddf12ae0b812e9c6d346b683cac4c4 Mon Sep 17 00:00:00 2001 From: Adrien Coulier Date: Fri, 25 Nov 2022 10:34:32 +0100 Subject: [PATCH] Run less tests on pull requests and push Solves #2044 --- .github/workflows/pytest.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 51987198f6..88f1fd0093 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -15,12 +15,25 @@ concurrency: cancel-in-progress: true jobs: - pytest: + select-strategy: runs-on: ubuntu-latest + outputs: + python-versions: ${{ steps.set-matrix.outputs.python-versions }} + steps: + - id: set-matrix + run: | + if [ ${{ github.event_name }} == "release" ]; then + echo "python-versions=[\"3.7\",\"3.8\",\"3.9\",\"3.10\",\"3.11\"]" >> $GITHUB_OUTPUT + else + echo "python-versions=[\"3.7\",\"3.11\"]" >> $GITHUB_OUTPUT + fi + pytest: + needs: select-strategy strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - + python-version: ${{ fromJson(needs.select-strategy.outputs.python-versions) }} + os: [ubuntu-20.04, ubuntu-22.04] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 name: Check out source-code repository