-
Notifications
You must be signed in to change notification settings - Fork 46
153 lines (132 loc) · 5.2 KB
/
copasi_se.yml
File metadata and controls
153 lines (132 loc) · 5.2 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Build and Test
on:
workflow_dispatch:
inputs:
build_type:
description: CMake build type
type: choice
required: true
default: Release
options:
- Release
- Debug
- RelWithDebInfo
- MinSizeRel
run_valgrind:
description: Run tests under Valgrind (Ubuntu only)
type: boolean
required: false
default: false
push:
paths:
- "**"
- "!.github/**"
- ".github/workflows/copasi_se.yml"
env:
BUILD_TYPE: ${{ github.event.inputs.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@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Add msbuild to PATH (Windows)
if: matrix.platform == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1.6.0
- 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 -n -qq ${{ 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
sudo apt update
sudo apt install -y uuid-dev
- 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: Update COPASI Version
shell: bash
working-directory: ${{github.workspace}}
run: ./gitTools/UpdateCopasiVersion
- name: Download SBML Test Suite cases
shell: bash
working-directory: ${{github.workspace}}
run: |
curl -L https://copasi.org/static/test-suite.zip -o test-suite.zip
unzip -n -qq test-suite.zip
- name: Configure COPASI (mac)
shell: bash
if: matrix.platform == 'macos-latest'
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DSBML_TESTSUITE_RUN=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DENABLE_JIT=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DBUILD_SBML_TESTSUITE:BOOL=ON -DSBML_TESTSUITE_CASES_DIR:PATH=$PWD/test-suite -S . -B ./build_copasi
- name: Configure COPASI
shell: bash
if: matrix.platform != 'macos-latest'
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOPASI_INSTALL_C_API=ON -DSBML_TESTSUITE_RUN=ON -DBUILD_TESTS=ON -DBUILD_GUI=OFF -DCOPASI_DEPENDENCY_DIR=./dependencies/ -DCMAKE_INSTALL_PREFIX=./install/ -DBUILD_SBML_TESTSUITE:BOOL=ON -DSBML_TESTSUITE_CASES_DIR:PATH=$PWD/test-suite -S . -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: Run test_api under GDB and valgrind
if: matrix.platform == 'ubuntu-latest' && github.event.inputs.run_valgrind == 'true'
working-directory: ${{github.workspace}}/build_copasi
shell: bash
run: |
export srcdir="${{github.workspace}}/tests"
TEST_API="$PWD/tests/test_api"
sudo apt-get install -y gdb valgrind
gdb -batch \
-ex "set pagination off" \
-ex run \
-ex "thread apply all bt full" \
-ex quit \
-- "$TEST_API" || true
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 --error-limit=no $TEST_API
- name: Test
working-directory: ${{github.workspace}}/build_copasi
shell: bash
run: ctest -C $BUILD_TYPE -V
- name: binary archive
uses: actions/upload-artifact@v4
with:
name:
copasi-se-${{ matrix.platform }}
path: ${{github.workspace}}/install/*
retention-days: 10
if-no-files-found: error