-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (152 loc) · 5.64 KB
/
build_and_release.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
name: Build Corsika8
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
fmt_version: 10.2.1
spdlog_version: 1.14.1
cubic_version: 0.1.5
proposal_version: 7.6.2
catch2_version: 3.6.0
yaml-cpp_version: 0.8.0
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install prerequisites
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y python3 python3-pip cmake g++ gfortran git doxygen graphviz \
libboost-all-dev libcli11-dev libeigen3-dev \
libre2-dev libzstd-dev liblz4-dev zlib1g-dev libprotobuf-dev \
nlohmann-json3-dev ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update -y
sudo apt install -y -V libarrow-dev libarrow-dataset-dev libparquet-dev
pip install pyarrow
- name: Build pre-installation file list
shell: bash
run: sudo find /usr -print > filelist_before.txt
- name: Install fmt library
shell: bash
run: |
mkdir fmt
cd fmt
wget -qO - https://github.com/fmtlib/fmt/archive/refs/tags/${{ env.fmt_version }}.tar.gz | tar zxf -
cd fmt-${{ env.fmt_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install spdlog library
shell: bash
run: |
mkdir spdlog
cd spdlog
wget -qO - https://github.com/gabime/spdlog/archive/refs/tags/v${{ env.spdlog_version }}.tar.gz | tar zxf -
cd spdlog-${{ env.spdlog_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install Catch2 library
shell: bash
run: |
mkdir Catch2
cd Catch2
wget -qO - https://github.com/catchorg/Catch2/archive/refs/tags/v${{ env.catch2_version }}.tar.gz | tar zxf -
cd Catch2-${{ env.catch2_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install yaml-cpp library
shell: bash
run: |
mkdir yaml-cpp
cd yaml-cpp
wget -qO - https://github.com/jbeder/yaml-cpp/archive/refs/tags/${{ env.yaml-cpp_version }}.tar.gz | tar zxf -
cd yaml-cpp-${{ env.yaml-cpp_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install Cubic Interpolation
shell: bash
run: |
mkdir cubic_interpolation
cd cubic_interpolation
wget -qO - https://github.com/tudo-astroparticlephysics/cubic_interpolation/archive/refs/tags/v${{ env.cubic_version }}.tar.gz | tar zxf -
cd cubic_interpolation-${{ env.cubic_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install PROPOSAL
shell: bash
run: |
mkdir proposal
cd proposal
wget -qO - https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/${{ env.proposal_version }}.tar.gz | tar zxf -
cd PROPOSAL-${{ env.proposal_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
sudo sed -i -e '/PROPOSAL_INCLUDE_DIR/s/\/include/\/usr\/include/' /usr/lib/x86_64-linux-gnu/cmake/PROPOSAL/PROPOSALConfig.cmake
sudo sed -i -e '/PROPOSAL_LIBRARIES/s/\/lib/\/usr\/lib/' /usr/lib/x86_64-linux-gnu/cmake/PROPOSAL/PROPOSALConfig.cmake
- name: Install Corsika 8
shell: bash
run: |
git clone --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git
sed -i -e '/^find_package(Arrow/s/$/\nfind_package(Parquet REQUIRED)/' corsika/CMakeLists.txt
sed -i -e '/^find_package(Boost/s/filesystem/filesystem math_tr1/' corsika/CMakeLists.txt
sed -i -e 's/Boost::filesystem/Boost::filesystem Boost::math_tr1/' corsika/CMakeLists.txt
mkdir corsika/build
cd corsika/build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=x86_64-linux-gnu \
-DCMAKE_PREFIX_PATH=/usr \
..
make -j4
sudo make install
- name: Build post-installation file list
shell: bash
run: sudo find /usr -print > filelist_after.txt
- name: Package Corsika 8 in TGZ file
shell: bash
run: |
cat filelist_before.txt filelist_after.txt | sort | uniq -u > filelist_diff.txt
sudo tar -zpcf corsika8_installed.tgz --ignore-failed-read -C / -T filelist_diff.txt
ls -l corsika8_installed.tgz
- name: Publish tar file in Github release
uses: softprops/action-gh-release@v2
with:
files: corsika8_installed.tgz
name: "Build of CORSIKA 8 on ${{ matrix.os }}"
tag_name: "${{ matrix.os }}"
body: Automated build of CORSIKA 8 and some dependencies
prerelease: true