-
Notifications
You must be signed in to change notification settings - Fork 35
45 lines (36 loc) · 1.38 KB
/
build-cmake.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
name: build-cmake
on: [push, pull_request, workflow_dispatch]
env:
HOMEBREW_DISPLAY_INSTALL_TIMES: "ON"
HOMEBREW_NO_ANALYTICS: "ON"
HOMEBREW_NO_AUTO_UPDATE: "ON"
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
HOMEBREW_NO_GITHUB_API: "ON"
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
jobs:
build-cmake:
name: ${{ matrix.os }}, gfortran-${{ matrix.ver }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
ver: [10] # 7, 8, 9
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install packages (ubuntu)
if: contains(matrix.os,'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.ver }} gfortran-${{ matrix.ver }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.ver }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.ver }}
- name: Install packages (macOS)
if: contains(matrix.os,'macos')
run: |
brew install gcc@${{ matrix.ver }} || brew upgrade gcc@${{ matrix.ver }} || true
- name: Build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc-${{ matrix.ver }} -DCMAKE_Fortran_COMPILER=gfortran-${{ matrix.ver }}
cmake --build build/ --target all