-
Notifications
You must be signed in to change notification settings - Fork 17
87 lines (74 loc) · 1.97 KB
/
test-fortran.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: test-fortran
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
env:
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker
HOMEBREW_NO_AUTO_UPDATE: "ON"
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
HOMEBREW_NO_GITHUB_API: "ON"
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
BUILD_DIR: _build
CMAKE_OPTIONS: >-
-DBUILD_EXAMPLES=ON -DBUILD_FASTSCAPELIB_SHARED=ON -DCMAKE_BUILD_TYPE=Debug
jobs:
gcc-build:
name: gcc (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Compiler (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
echo "FC=gfortran" >> $GITHUB_ENV
echo "CC=gcc" >> $GITHUB_ENV
- name: Install and Set Compiler (MacOS)
if: contains(matrix.os, 'macos')
run: |
brew reinstall gfortran
echo "FC=gfortran" >> $GITHUB_ENV
echo "CC=gcc" >> $GITHUB_ENV
- name: Configure build
run: cmake -B ${BUILD_DIR} ${CMAKE_OPTIONS}
- name: Build project
run: cmake --build ${BUILD_DIR}
- name: Run Fan example
run: |
cd ${BUILD_DIR}/examples
./Fan
mingw-build:
name: mingw (windows-latest)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
- name: Configure build
run: cmake -B ${BUILD_DIR} -G Ninja ${CMAKE_OPTIONS}
env:
FC: gfortran
CC: gcc
- name: Build project
run: cmake --build ${BUILD_DIR}
- name: Run Fan example
run: |
cd ${BUILD_DIR}/examples
./Fan.exe