Skip to content

Commit ded5f16

Browse files
committed
250904.224947.CST revise test_gfortran.yml
1 parent 3a76caa commit ded5f16

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/test_gfortran.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
3131
compiler: [gcc]
32-
version: [13, 14] # Too expensive to test all versions
32+
version: [12, latest] # Too expensive to test all versions
3333
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
3434
testdim: [small, big]
3535

@@ -85,16 +85,27 @@ jobs:
8585
if: runner.os == 'Windows'
8686
run: $env:Path += ";C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\ProgramData\Chocolatey\bin"
8787

88+
- name: Decide the gfortran version to use
89+
shell: bash
90+
run: |
91+
if [[ "${{ matrix.version }}" == "latest" ]]; then
92+
export GFORTRAN_VERSION=${{ env.GFORTRAN_VERSION }}
93+
else
94+
export GFORTRAN_VERSION=${{ matrix.version }}
95+
echo "GFORTRAN_VERSION=${GFORTRAN_VERSION}" >> $GITHUB_ENV
96+
fi
97+
echo "To use gfortran version ${GFORTRAN_VERSION}"
98+
8899
- name: Set up Fortran
89100
if: ${{ matrix.os != 'macos-latest' }}
90101
uses: fortran-lang/setup-fortran@main
91102
with:
92103
compiler: ${{ matrix.compiler }}
93-
version: ${{ matrix.version }}
104+
version: ${{ env.GFORTRAN_VERSION }}
94105
- name: Set up Fortran for macOS latest # As of 20250816, fortran-lang/setup-fortran does not support macos-15
95106
if: ${{ matrix.os == 'macos-latest' }}
96107
run: |
97-
sudo ln -sf $(which gfortran-${{ matrix.version }}) $(dirname $(which gfortran-${{ matrix.version }}))/gfortran
108+
sudo ln -sf $(which gfortran-${{ env.GFORTRAN_VERSION }}) $(dirname $(which gfortran-${{ env.GFORTRAN_VERSION }}))/gfortran
98109
99110
- name: Check gfortran version
100111
shell: bash

0 commit comments

Comments
 (0)