diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index dd648d78f..ddabe6560 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -14,22 +14,26 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + 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'} steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.combos.python_version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.combos.python_version }} - name: Delete old cached file with same python version run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.python-version }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.python-version }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -37,8 +41,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-${{ matrix.combos.venv_suffix }} + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -47,12 +51,13 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.combos.venv_suffix }} + key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + which python python --version pip --version pip list diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 9e648d3ec..9ae47d1f1 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -22,7 +22,6 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - python-version: ['3.10'] group: [1, 2, 3, 4, 5, 6] steps: @@ -45,25 +44,25 @@ jobs: id: check_changes run: echo "has_changes=${{ steps.changes.outputs.has_changes }}" >> $GITHUB_ENV - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.10' - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-10 + key: ${{ runner.os }}-venv-10-${{ 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.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-10 + source .venv-10/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -77,7 +76,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-10/bin/activate pwd lscpu pip list @@ -98,7 +97,7 @@ jobs: if: always() && env.has_changes == 'true' uses: actions/upload-artifact@v4 with: - name: regression_test_artifact-${{ matrix.python-version }}-${{ matrix.group }} + name: regression_test_artifact-3.10-${{ matrix.group }} path: | ./cov.xml ./mpl_results.html diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 6e8ebc7a6..4392c1ed3 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'}, - {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'}] + 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'}] steps: - uses: actions/checkout@v4 @@ -61,15 +61,15 @@ jobs: id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.combos.python_version }} - key: ${{ runner.os }}-venv-${{ matrix.combos.python_version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.combos.venv_suffix }} + key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ 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.python_version }} - source .venv-${{ matrix.combos.python_version }}/bin/activate + python -m venv .venv-${{ matrix.combos.venv_suffix }} + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -80,13 +80,20 @@ jobs: with: swap-size-gb: 10 - - name: Test with pytest + - name: Action Details if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.python_version }}/bin/activate + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + which python + python --version pwd lscpu pip list + + - name: Test with pytest + if: env.has_changes == 'true' + run: | + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pytest -v -m unit \ --durations=0 \ --cov-report xml:cov.xml \