-
Notifications
You must be signed in to change notification settings - Fork 1
134 lines (112 loc) · 4.62 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CMake
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
name:
${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Add msbuild to PATH (Windows)
if: matrix.platform == 'windows-latest'
uses: ilammy/[email protected]
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
shell: bash
run: |
cmake --version
curl -L https://github.com/copasi/copasi-dependencies/releases/latest/download/${{ matrix.platform }}.zip -o ${{ matrix.platform }}.zip
unzip ${{ matrix.platform }}.zip -d dependencies
- name: Patch dependencies (windows)
shell: bash
if: matrix.platform == 'windows-latest'
working-directory: ${{github.workspace}}/dependencies/lib/cmake
run: |
sed -i 's|D:/a/copasi-dependencies/copasi-dependencies/install/|${_IMPORT_PREFIX}/|g' *.cmake
- name: Patch dependencies (ubuntu)
shell: bash
if: matrix.platform == 'ubuntu-latest'
working-directory: ${{github.workspace}}/dependencies/lib/cmake
run: |
sed -i 's|/home/runner/work/copasi-dependencies/copasi-dependencies/install/|${_IMPORT_PREFIX}/|g' *.cmake
- name: Patch dependencies (mac)
shell: bash
if: matrix.platform == 'macos-latest'
working-directory: ${{github.workspace}}/dependencies/lib/cmake
run: |
sed -i '.tmp' 's|/Users/runner/work/copasi-dependencies/copasi-dependencies/install/|${_IMPORT_PREFIX}/|g' *.cmake
rm lapack*
rm ../libblas.a
rm ../liblapack.a
rm ../libf2c.a
rm ../../include/clapack.h
rm ../../include/lapack.h
rm ../../include/blaswrap.h
rm ../../include/f2c.h
- name: Download COPASI
shell: bash
run: |
git clone --single-branch --branch release/Version-4.37 https://github.com/copasi/COPASI
- name: Update COPASI Version
shell: bash
working-directory: ${{github.workspace}}/COPASI
run: ./gitTools/UpdateCopasiVersion
- name: Configure COPASI
shell: bash
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./dependencies/ -S ./COPASI -B ./build_copasi
- name: Build COPASI
shell: bash
working-directory: ${{github.workspace}}/build_copasi
run: cmake --build . --config $BUILD_TYPE
- name: Install COPASI
shell: bash
working-directory: ${{github.workspace}}/build_copasi
run: cmake --build . --config $BUILD_TYPE --target install
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=./install/ -DCPSAPI_DEPENDENCY_DIR=./dependencies/ -S . -B ./build
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE -V
- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
- name: binary archive
uses: actions/upload-artifact@v2
with:
name:
cpsapi-${{ matrix.platform }}
path: ${{github.workspace}}/install/*
retention-days: 1
if-no-files-found: error
- name: binary dependency archive
uses: actions/upload-artifact@v2
with:
name:
dependencies-${{ matrix.platform }}
path: ${{github.workspace}}/dependencies/*
retention-days: 1
if-no-files-found: error