-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.67 KB
/
run_examples.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
54
55
56
57
58
59
60
61
62
63
name: run_examples
on: [push, pull_request]
jobs:
gfortran-nix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11]
gcc_v: [10]
build: [cmake]
include:
- os: ubuntu-latest
os-arch: linux-x86_64
debug-flags: '-g -fbacktrace -Og -fcheck=all'
- os: macos-11
os-arch: macos-x86_64
debug-flags: '-g -fbacktrace -Og -fcheck=all'
env:
FC: gfortran
GCC_V: ${{ matrix.gcc_v }}
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install GFortran (MacOS)
if: contains(matrix.os, 'macos')
run: |
ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran
which gfortran-${GCC_V}
which gfortran
- name: Install GFortran (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
- name: Configure with CMake
if: ${{ contains(matrix.build, 'cmake') }}
run: >-
cmake
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_Fortran_FLAGS="${{ matrix.debug-flags }}"
-S . -B ${{ env.BUILD_DIR }}
- name: Build and compile
if: ${{ contains(matrix.build, 'cmake') }}
run: cmake --build ${{ env.BUILD_DIR }}
- name: Run example programs
run: |
./build/ex1
./build/ex2
./build/ex3
./build/ex4
./build/ex5