-
Notifications
You must be signed in to change notification settings - Fork 80
95 lines (86 loc) · 2.7 KB
/
cmake_ci.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
88
89
90
91
92
93
94
95
name: cmake ci linux macos windows
on:
push:
release:
types: [published]
jobs:
cmake-ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
- ubuntu-22.04
- macos-13
compiler:
- llvm
- gcc
# you can specify the version after `-` like `llvm-13.0.0`.
generator:
- "Ninja"
build_type:
- Release
finufft_static_linking:
- ON
include:
- os: "windows-2022"
compiler: "msvc"
generator: "Ninja"
build_type: "Release"
finufft_static_linking: "OFF"
exclude:
- os: "windows-2022"
compiler: "gcc"
generator: "Ninja"
build_type: "Release"
steps:
- uses: actions/checkout@v4
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true
vcpkg: false
cppcheck: false
clangtidy: false
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install fftw
- name: Configure Cmake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DFINUFFT_BUILD_TESTS=ON -DFINUFFT_STATIC_LINKING=${{matrix.finufft_static_linking}}
- name: Build
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Test
working-directory: ./build
run: |
ctest -C ${{matrix.build_type}}
# may change to cpack and action-gh-release later
- name: Upload static and shared lib
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}-${{matrix.compiler}}-finufft-lib
path: ${{runner.workspace}}/finufft/build/*finufft*
- name: Pack For Release
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'published'
shell: bash
run: |
cd build
if [[ "${{ matrix.os }}" == "windows-2022" ]]
then
7z a ../${{matrix.os}}-${{matrix.compiler}}-finufft-lib.zip *finufft*
else
tar czvf ../${{matrix.os}}-${{matrix.compiler}}-finufft-lib.tar.gz *finufft*
fi
cd -
- name: Publish
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'published'
with:
files: |
*-finufft-lib*