-
Notifications
You must be signed in to change notification settings - Fork 25
210 lines (195 loc) · 7.46 KB
/
validation.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: validation
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build_and_validate:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "windows",
os: windows-latest,
artifact: "bng_windows_cygwin.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja"
}
- {
name: "linux",
os: ubuntu-20.04,
artifact: "bng_ubuntu_gcc.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja"
}
- {
name: "mac",
os: macos-latest,
artifact: "bng_macos_clang.7z",
build_type: "Release",
cc: "clang",
cxx: "clang++",
archiver: "7za a",
generators: "Ninja"
}
steps:
- name: Checkout repo # and submodules
uses: actions/checkout@v2
with:
submodules: recursive
# Windows setup
- name: Set up Cygwin
if: startsWith(matrix.config.os, 'windows')
uses: egor-tensin/setup-cygwin@v4
with:
packages: cmake gcc-g++ autoconf automake libtool dos2unix pkg-config make
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Setup ninja on windows
if: startsWith(matrix.config.os, 'windows')
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Setup windows and untar libs
if: startsWith(matrix.config.os, 'windows')
working-directory: ./bng2
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
cd /cygdrive/d/a/bionetgen/bionetgen/bng2/Network3
mkdir m4
dos2unix configure.ac Makefile.am Makefile.cmake
tar xvfz ../libsource/cvode-2.6.0.tar.gz
tar xvfz ../libsource/muparser_v2_2_4.tar.gz
# Unix setup
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'linux')
run: |
sudo apt-get update
sudo apt-get install cmake
cmake --version
gcc --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'mac')
# also install p7zip if we are achiving
run: |
brew install cmake
cmake --version
# look at environment variables for debugging
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
# Unix compilation
- name: Make-unix
if: ${{ startsWith(matrix.config.name, 'mac') || startsWith(matrix.config.name, 'linux') }}
shell: bash
working-directory: ./bng2
run: |
make
# Windows compilation
- name: Make-network-windows
if: startsWith(matrix.config.name, 'windows')
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
cd /cygdrive/d/a/bionetgen/bionetgen/bng2
export _BNGPATH=$PWD
cd Network3
autoreconf --no-recursive --install
./configure --disable-shared --prefix=${_BNGPATH}
make
mkdir /cygdrive/d/a/bionetgen/bionetgen/bng2/bin
cp src/run_network.exe /cygdrive/d/a/bionetgen/bionetgen/bng2/bin/run_network.exe
# - name: Make-nfsim-windows
# if: startsWith(matrix.config.name, 'windows')
# shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
# working-directory: ./bng2
# run: |
# cd /cygdrive/d/a/bionetgen/bionetgen/bng2/nfsim_src
# mkdir build
# cd build
# /cygdrive/c/Program\ Files/CMake/bin/cmake.exe -G "Ninja" ..
# ninja
# cp NFsim.exe ../../bin/.
# - name: Make-nfsim-unix
# if: ${{ startsWith(matrix.config.name, 'mac') || startsWith(matrix.config.name, 'linux') }}
# working-directory: ./bng2
# run: |
# mkdir nfsim_src/build
# cd nfsim_src/build
# cmake --build ${{github.workspace}}/bng2/nfsim_src/build --config ${{env.BUILD_TYPE}}
# now everything is compiled, we validate
# windows validation
- name: validate for windows
if: startsWith(matrix.config.name, 'windows')
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
cd /cygdrive/d/a/bionetgen/bionetgen/bng2/Validate
perl validate_examples.pl
# unix validation
- name: validate for unix
if: ${{ startsWith(matrix.config.name, 'mac') || startsWith(matrix.config.name, 'linux') }}
shell: bash
working-directory: ./bng2/Validate
run: |
perl validate_examples.pl
# bundling everything
# unix first
- name: Prepare unix bundle
if: ${{ startsWith(matrix.config.name, 'mac') || startsWith(matrix.config.name, 'linux') }}
working-directory: ./bng2
run: |
mkdir bng_bundle
cp BNG2.pl CHANGES.txt CREDITS.txt ../LICENSE VERSION bng_bundle/.
cp -r Models2 Network3 Perl2 Validate bin bng_bundle/.
tar cvf bng_bundle.tar bng_bundle
- name: Archive unix bundle
if: ${{ startsWith(matrix.config.name, 'mac') || startsWith(matrix.config.name, 'linux') }}
uses: actions/upload-artifact@v3
with:
name: bng_bundle_${{ matrix.config.name }}
path: ${{github.workspace}}/bng2/bng_bundle.tar
# windows next
- name: Prepare windows bundle
if: startsWith(matrix.config.name, 'windows')
run: |
cd D:/a/bionetgen/bionetgen/bng2
mkdir bng_bundle
cp BNG2.pl bng_bundle/.
cp CHANGES.txt bng_bundle/.
cp CREDITS.txt bng_bundle/.
cp ../LICENSE bng_bundle/.
cp VERSION bng_bundle/.
cp VERSION bng_bundle/.
cp -r Models2 bng_bundle/.
cp -r Network3 bng_bundle/.
cp -r Perl2 bng_bundle/.
cp -r Validate bng_bundle/.
cp -r bin bng_bundle/.
cp C:/tools/cygwin/bin/cygwin*dll bng_bundle/bin/.
cp C:/tools/cygwin/bin/cygstdc*dll bng_bundle/bin/.
cp C:/tools/cygwin/bin/cygz*dll bng_bundle/bin/.
cp C:/tools/cygwin/bin/cyggcc*dll bng_bundle/bin/.
tar cvf bng_bundle.tar bng_bundle
# /c/tools/cygwin/bin/cygwin1.dll
# needed files: cygwin1.dll,cygstdc++-6.dll,cygz.dll,cyggcc_s-seh-1.dll
# potentially we also need 1) libgcc_s_dw2-1.dll, 2) libstdc++-6.dll
- name: Archive windows bundle
if: startsWith(matrix.config.name, 'windows')
uses: actions/upload-artifact@v3
with:
name: bng_bundle_${{ matrix.config.name }}
path: D:/a/bionetgen/bionetgen/bng2/bng_bundle.tar