11name : fpm
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches : ["master"]
6+ pull_request :
7+ branches : ["master"]
48
59jobs :
6- gcc-build :
10+ build-and-test :
11+ name : ${{ matrix.os }} / ${{ matrix.compiler }} / shared=${{ matrix.shared }}
712 runs-on : ${{ matrix.os }}
813 strategy :
914 fail-fast : false
1015 matrix :
11- os : [ubuntu-latest]
12- gcc_v : [14] # Version of GFortran we want to use.
1316 include :
14- - os : ubuntu-latest
15- os-arch : linux-x86_64
16-
17- env :
18- FC : gfortran
19- GCC_V : ${{ matrix.gcc_v }}
17+ - os : ubuntu-latest
18+ compiler : gcc
19+ version : ' 14'
20+ shared : false
21+ - os : ubuntu-latest
22+ compiler : gcc
23+ version : ' 14'
24+ shared : true
25+ - os : ubuntu-latest
26+ compiler : gcc
27+ version : ' 15'
28+ shared : false
29+ - os : ubuntu-latest
30+ compiler : gcc
31+ version : ' 15'
32+ shared : true
33+ - os : ubuntu-latest
34+ compiler : intel
35+ version : ' 2023.2'
36+ shared : true
2037
2138 steps :
22- - name : Checkout code
23- uses : actions/checkout@v1
24-
25- - name : Install GFortran Linux
26- if : contains(matrix.os, 'ubuntu')
27- run : |
28- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
29- --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
30- --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
31-
32- - name : Install BLAS & LAPACK
33- if : contains(matrix.os, 'ubuntu')
34- run : |
35- sudo apt-get update
36- sudo apt-get install libopenblas-dev liblapack-dev
37-
38- - name : Install fpm
39- uses : fortran-lang/setup-fpm@v5
40- with :
41- fpm-version : ' v0.10.1'
42-
43- - name : Build NONLIN
44- run : |
45- gfortran --version
46- fpm build
47-
48- - name : Run tests
49- run : |
50- gfortran --version
51- fpm test
52-
53- # msys2-build:
54- # runs-on: windows-latest
55- # defaults:
56- # run:
57- # shell: msys2 {0}
58-
59- # steps:
60- # - uses: actions/checkout@v2
61- # - uses: msys2/setup-msys2@v2
62- # with:
63- # msystem: MINGW64
64- # update: true
65- # path-type: inherit
66- # install: |
67- # mingw-w64-x86_64-gcc-fortran
68- # mingw-w64-x86_64-fpm
69- # mingw-w64-x86_64-openblas
70- # mingw-w64-x86_64-lapack
71-
72- # - name: fpm build
73- # run: |
74- # gfortran --version
75- # fpm --version
76- # fpm build
77-
78- # - name: fpm test
79- # run: |
80- # fpm test
81-
82- # intel-build:
83- # runs-on: ubuntu-latest
84- # strategy:
85- # fail-fast: false
86-
87- # env:
88- # FPM_FC: ifx
89- # FC: ifx
90-
91- # steps:
92- # - name: Checkout code
93- # uses: actions/checkout@v3
94-
95- # - name: Add Intel repository (Linux)
96- # run: |
97- # wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
98- # sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
99- # rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
100- # echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
101- # sudo apt-get update
102-
103- # - name: Install Intel oneAPI compiler (Linux)
104- # run: |
105- # sudo apt-get install intel-oneapi-compiler-fortran
106-
107- # - name: Setup Intel oneAPI environment
108- # run: |
109- # source /opt/intel/oneapi/setvars.sh
110- # printenv >> $GITHUB_ENV
111-
112- # - name: Install MKL
113- # run: |
114- # sudo apt-get update
115- # sudo apt-get -y install intel-mkl
116- # sudo apt update
117- # sudo apt -y install intel-mkl
118-
119- # - name: Install fpm
120- # uses: fortran-lang/setup-fpm@v3
121- # with:
122- # fpm-version: 'v0.8.2'
123-
124- # - name: fpm build
125- # run: |
126- # ifx --version
127- # fpm --version
128- # fpm build --profile debug --flag "-warn nointerfaces"
129-
130- # - name: fpm test
131- # run: |
132- # fpm test --profile debug --flag "-warn nointerfaces"
39+ - name : Checkout code
40+ uses : actions/checkout@v4
41+
42+ - name : Set up Fortran toolchain
43+ uses : fortran-lang/setup-fortran@v1
44+ id : setup-fortran
45+ with :
46+ compiler : ${{ matrix.compiler }}
47+ version : ${{ matrix.version }}
48+
49+ - name : Show compiler version
50+ shell : bash
51+ env :
52+ FC : ${{ steps.setup-fortran.outputs.fc }}
53+ CC : ${{ steps.setup-fortran.outputs.cc }}
54+ run : |
55+ "$FC" --version
56+
57+ - name : Install BLAS/LAPACK (Linux)
58+ if : runner.os == 'Linux'
59+ shell : bash
60+ run : |
61+ sudo apt-get update
62+ sudo apt-get install -y libopenblas-dev liblapack-dev
63+
64+ - name : Install fpm
65+ uses : fortran-lang/setup-fpm@v5
66+ with :
67+ fpm-version : ' v0.10.1'
68+
69+ - name : Build NONLIN
70+ shell : bash
71+ env :
72+ FC : ${{ steps.setup-fortran.outputs.fc }}
73+ CC : ${{ steps.setup-fortran.outputs.cc }}
74+ FPM_FC : ${{ steps.setup-fortran.outputs.fc }}
75+ FPM_CC : ${{ steps.setup-fortran.outputs.cc }}
76+ FPM_FLAGS : ${{ matrix.shared && '--flag=-fPIC' || '' }}
77+ run : |
78+ if [[ -n "$FPM_FLAGS" ]]; then
79+ fpm build $FPM_FLAGS
80+ else
81+ fpm build
82+ fi
83+
84+ - name : Run tests
85+ shell : bash
86+ env :
87+ FC : ${{ steps.setup-fortran.outputs.fc }}
88+ CC : ${{ steps.setup-fortran.outputs.cc }}
89+ FPM_FC : ${{ steps.setup-fortran.outputs.fc }}
90+ FPM_CC : ${{ steps.setup-fortran.outputs.cc }}
91+ FPM_FLAGS : ${{ matrix.shared && '--flag=-fPIC' || '' }}
92+ run : |
93+ if [[ -n "$FPM_FLAGS" ]]; then
94+ fpm test $FPM_FLAGS
95+ else
96+ fpm test
97+ fi
0 commit comments