-
Notifications
You must be signed in to change notification settings - Fork 29
71 lines (60 loc) · 1.73 KB
/
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
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
name: CMake
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
INSTALL_PREFIX: /tmp/hstcal
jobs:
build_matrix:
strategy:
matrix:
os: [ubuntu-latest, macos-12, macos-14]
gcc: [12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install -y libcfitsio-dev gfortran pkg-config
- name: MacOS dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install gcc@${{ matrix.gcc }} cfitsio
- name: Linux build
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_PREFIX }}
make
- name: MacOS build
if: startsWith(matrix.os, 'macos')
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
FC: gfortran-${{ matrix.gcc }}
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_PREFIX }}
make
- name: Install
run: |
cd build
make install
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}