-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (46 loc) · 1.92 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain:
- {compiler: gcc, version: 13, flags: ['-cpp -O3 -march=native']}
- {compiler: intel, version: '2023.2', flags: ['-fpp -O3 -xhost']}
- {compiler: intel-classic, version: '2021.10', flags: ['-fpp -O3 -xhost']}
- {compiler: nvidia-hpc, version: '23.11', flags: ['-Mpreprocess -Ofast']}
include:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 12, flags: ['-cpp -O3 -march=native']}
exclude:
- os: macos-latest
toolchain: {compiler: intel, version: '2023.2'}
- os: macos-latest
toolchain: {compiler: nvidia-hpc, version: '23.11'}
- os: windows-latest
toolchain: {compiler: nvidia-hpc, version: '23.11'}
steps:
- name: Checkout code
uses: actions/checkout@v1
- uses: fortran-lang/setup-fortran@main
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Setup Fortran Package Manager
uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Fortran on MacOS
if: contains( matrix.os, 'macos')
run: |
brew reinstall gcc@13
ln -s /usr/local/lib/gcc/13/libgfortran.5.dylib /usr/local/lib/
ln -s /usr/local/lib/gcc/13/libquadmath.0.dylib /usr/local/lib/
- run: |
fpm test --compiler ${{ env.FC }} --c-compiler ${{ env.CC }} --cxx-compiler ${{ env.CXX }} --flag "${{ join(matrix.toolchain.flags, ' ') }}"
# ${{ env.FC }} ... # environment vars FC, CC, and CXX are set
# ${{ steps.setup-fortran.outputs.fc }} ... # outputs work too