Skip to content

Commit 5049c95

Browse files
authored
Setup CI (#18)
2 parents 2f26661 + e041337 commit 5049c95

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-test:
7+
runs-on: ${{ matrix.os }}
8+
timeout-minutes: 10
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
toolchain:
13+
- {compiler: gcc, version: 13}
14+
- {compiler: intel, version: '2025.0'}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup fortran
20+
uses: fortran-lang/setup-fortran@v1.6.3
21+
with:
22+
compiler: ${{ matrix.toolchain.compiler }}
23+
version: ${{ matrix.toolchain.version }}
24+
25+
- name: Setup fpm
26+
uses: fortran-lang/setup-fpm@v6.1.0
27+
with:
28+
fpm-version: 'v0.10.1'
29+
# run: |
30+
# # Download fpm source file
31+
# curl -LO https://github.com/fortran-lang/fpm/releases/download/v0.10.1/fpm-0.10.1.F90
32+
#
33+
# # Compile fpm with the current Fortran compiler
34+
# ${FC} -o fpm fpm-0.10.1.F90
35+
#
36+
# # Install fpm (add to the path)
37+
# mv fpm /usr/local/bin/
38+
39+
- name: Set correct Fortran compiler and library path
40+
if: matrix.os == 'macos-latest'
41+
run: |
42+
echo "FPM_FC=gfortran-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
43+
echo "$(brew --prefix gcc)/bin" >> $GITHUB_PATH
44+
echo "DYLD_FALLBACK_LIBRARY_PATH=$(brew --prefix gcc)/lib/gcc/current" >> $GITHUB_ENV
45+
46+
- name: Build
47+
run: |
48+
fpm build --profile debug
49+
50+
- name: Run unit tests
51+
run: fpm test
52+
53+

0 commit comments

Comments
 (0)