diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 8919a1123..8b8fdc9ed 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -14,19 +14,15 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - combos: - - {python_version: '3.9', venv_suffix: '9'} - - {python_version: '3.10', venv_suffix: '10'} - - {python_version: '3.11.11', venv_suffix: '11'} - - {python_version: '3.12.8', venv_suffix: '12'} + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.combos.python_version }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.combos.python_version }} + python-version: ${{ matrix.python-version }} - name: Check full Python version run: | diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 9ae47d1f1..19122267c 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -22,6 +22,7 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: + python-version: ['3.10'] group: [1, 2, 3, 4, 5, 6] steps: @@ -44,25 +45,32 @@ jobs: id: check_changes run: echo "has_changes=${{ steps.changes.outputs.has_changes }}" >> $GITHUB_ENV - - name: Set up Python 3.10 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ matrix.python-version }} + + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-10 - key: ${{ runner.os }}-venv-10-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-10 - source .venv-10/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -76,7 +84,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-10/bin/activate + source .venv-${{ env.version }}/bin/activate pwd lscpu pip list @@ -97,7 +105,7 @@ jobs: if: always() && env.has_changes == 'true' uses: actions/upload-artifact@v4 with: - name: regression_test_artifact-3.10-${{ matrix.group }} + name: regression_test_artifact-${{ matrix.python-version }}-${{ matrix.group }} path: | ./cov.xml ./mpl_results.html diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 4392c1ed3..023e6503b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -22,14 +22,14 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - combos: [{group: 1, python_version: '3.9', venv_suffix: '9'}, - {group: 2, python_version: '3.10', venv_suffix: '10'}, - {group: 3, python_version: '3.11.11', venv_suffix: '11'}, - {group: 4, python_version: '3.12.8', venv_suffix: '12'}, - {group: 5, python_version: '3.12.8', venv_suffix: '12'}, - {group: 6, python_version: '3.12.8', venv_suffix: '12'}, - {group: 7, python_version: '3.12.8', venv_suffix: '12'}, - {group: 8, python_version: '3.12.8', venv_suffix: '12'}] + combos: [{group: 1, python_version: '3.9'}, + {group: 2, python_version: '3.10'}, + {group: 3, python_version: '3.11'}, + {group: 4, python_version: '3.12'}, + {group: 5, python_version: '3.12'}, + {group: 6, python_version: '3.12'}, + {group: 7, python_version: '3.12'}, + {group: 8, python_version: '3.12'}] steps: - uses: actions/checkout@v4 @@ -56,20 +56,27 @@ jobs: with: python-version: ${{ matrix.combos.python_version }} + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV + - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.combos.venv_suffix }} - key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.combos.venv_suffix }} - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -83,7 +90,7 @@ jobs: - name: Action Details if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + source .venv-${{ env.version }}/bin/activate which python python --version pwd @@ -93,7 +100,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + source .venv-${{ env.version }}/bin/activate python -m pytest -v -m unit \ --durations=0 \ --cov-report xml:cov.xml \