Skip to content

Commit b9b90e4

Browse files
committed
Update test-suite workflow to use the fortran-lang github action to access intel compilers.
1 parent 549ee97 commit b9b90e4

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

.github/workflows/test_suite.yml

+46-2
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,56 @@ jobs:
1717
# This workflow contains a single job called "test-suite"
1818
test-suite:
1919
# The type of runner that the job will run on
20-
runs-on: ubuntu-latest
20+
runs-on: ${{ matrix.os }}
2121
strategy:
2222
fail-fast: false
2323
matrix:
24+
os:
25+
- ubuntu-latest
26+
# - macos-latest
27+
# - windows-latest
28+
toolchain:
29+
- {compiler: gcc, version: 13}
30+
- {compiler: gcc, version: 12}
31+
- {compiler: gcc, version: 11}
32+
- {compiler: gcc, version: 10}
33+
- {compiler: gcc, version: 9}
34+
- {compiler: intel, version: '2024.1'}
35+
- {compiler: intel-classic, version: '2021.10'}
36+
# - {compiler: nvidia-hpc, version: '23.11'}
2437
std: ["f2008", "f2018"]
38+
include:
39+
# Run 2018 Fortran standards on latest gcc only
40+
- toolchain: {compiler: gcc, version: 13}
41+
std: "f2018"
42+
# Oldest possible gcc and standard on macos
43+
- os: macos-latest
44+
toolchain: {compiler: gcc, version: 9}
45+
std: "f2008"
46+
# Newest possible intel-classic and standard on macos
47+
- os: macos-latest
48+
toolchain: {compiler: intel-classic, version: '2021.10'}
49+
std: "f2018"
50+
# exclude:
51+
# - os: windows-latest
52+
# toolchain: {compiler: nvidia-hpc, version: '23.11'}
2553

2654
# Steps represent a sequence of tasks that will be executed as part of the job
2755
steps:
2856
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2957
- name: Checkout code
3058
uses: actions/checkout@v4
3159

60+
- name: setup-fortran
61+
uses: fortran-lang/setup-fortran@v1
62+
with:
63+
compiler: ${{ matrix.toolchain.compiler }}
64+
version: ${{ matrix.toolchain.version }}
65+
66+
- name: check-compilers-env
67+
run: |
68+
${{ steps.setup-fortran.outputs.fc }}
69+
3270
- name: Install Python
3371
uses: actions/setup-python@v5
3472
with:
@@ -49,7 +87,13 @@ jobs:
4987
export BUILD_DIR=$(pwd)/src/build
5088
mkdir ${BUILD_DIR}
5189
cd ${BUILD_DIR}
52-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} -DCMAKE_BUILD_TESTS=TRUE -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}"
90+
cmake .. -DCMAKE_BUILD_TYPE=Release \
91+
-DCMAKE_Fortran_COMPILER=${{ env.FC }} \
92+
-DCMAKE_C_COMPILER=${{ env.CC }} \
93+
-DCMAKE_CXX_COMPILER=${{ env.CXX }} \
94+
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR}\
95+
-DCMAKE_BUILD_TESTS=TRUE \
96+
-DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}"
5397
cmake --build .
5498
cmake --install .
5599

0 commit comments

Comments
 (0)