Skip to content

Commit 285b9ef

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

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed

.github/workflows/test_suite.yml

+50-2
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,60 @@ 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+
# Newest possible gcc on macos-latest (arm64)
43+
- os: macos-latest
44+
toolchain: {compiler: gcc, version: 13}
45+
std: "f2008"
46+
# Oldest possible gcc and standard on macos-latest (arm64)
47+
- os: macos-latest
48+
toolchain: {compiler: gcc, version: 11}
49+
std: "f2008"
50+
# Newest possible intel-classic and standard on newest compatible macos
51+
- os: macos-14
52+
toolchain: {compiler: intel-classic, version: '2021.10'}
53+
std: "f2018"
54+
# exclude:
55+
# - os: windows-latest
56+
# toolchain: {compiler: nvidia-hpc, version: '23.11'}
2557

2658
# Steps represent a sequence of tasks that will be executed as part of the job
2759
steps:
2860
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2961
- name: Checkout code
3062
uses: actions/checkout@v4
3163

64+
- name: setup-fortran
65+
uses: fortran-lang/setup-fortran@v1
66+
with:
67+
compiler: ${{ matrix.toolchain.compiler }}
68+
version: ${{ matrix.toolchain.version }}
69+
70+
- name: check-compilers-env
71+
run: |
72+
${{ steps.setup-fortran.outputs.fc }}
73+
3274
- name: Install Python
3375
uses: actions/setup-python@v5
3476
with:
@@ -49,7 +91,13 @@ jobs:
4991
export BUILD_DIR=$(pwd)/src/build
5092
mkdir ${BUILD_DIR}
5193
cd ${BUILD_DIR}
52-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} -DCMAKE_BUILD_TESTS=TRUE -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}"
94+
cmake .. -DCMAKE_BUILD_TYPE=Release \
95+
-DCMAKE_Fortran_COMPILER=${{ env.FC }} \
96+
-DCMAKE_C_COMPILER=${{ env.CC }} \
97+
-DCMAKE_CXX_COMPILER=${{ env.CXX }} \
98+
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR}\
99+
-DCMAKE_BUILD_TESTS=TRUE \
100+
-DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}"
53101
cmake --build .
54102
cmake --install .
55103

0 commit comments

Comments
 (0)