Skip to content

Commit dbd0f9a

Browse files
committed
Add build automations (deb and conda)
1 parent f7f9f67 commit dbd0f9a

13 files changed

Lines changed: 170 additions & 399 deletions

File tree

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: build_and_test
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
# - name: Install dependencies
16+
# run: |
17+
# sudo apt-get update
18+
# sudo apt-get install -y g++ cppcheck python3-pip
19+
# pip3 install "cmake>=4.0"
20+
# cmake --version
21+
22+
- name: Set up Miniconda
23+
uses: conda-incubator/setup-miniconda@v3
24+
with:
25+
auto-update-conda: true
26+
python-version: 3.12
27+
channels: conda-forge,nodefaults
28+
activate-environment: build-env
29+
30+
- name: Install build tools
31+
shell: bash -l {0}
32+
run: |
33+
conda install -y conda-build make gxx_linux-64 cmake>=4.0
34+
cmake --version
35+
conda-build --version
36+
37+
- name: Configure CMake
38+
shell: bash -l {0}
39+
run: |
40+
mkdir -p build
41+
cd build
42+
cmake ..
43+
44+
- name: Build
45+
shell: bash -l {0}
46+
run: |
47+
cd build
48+
make -j$(nproc)
49+
50+
- name: Run tests
51+
shell: bash -l {0}
52+
run: |
53+
cd build
54+
ctest --output-on-failure --verbose
55+
56+
# - name: Run cppcheck
57+
# uses: deep5050/cppcheck-action@main
58+
# with:
59+
# skip_preprocessor: disable
60+
# enable: all #performance,portability,warning
61+
# exclude_check: ./__tests__/exclude/
62+
# inconclusive: disable
63+
# inline_suppression: disable
64+
# force_language: c++
65+
# force: enable
66+
# max_ctu_depth: 12
67+
# platform: disable
68+
# output_file: cppcheck_report.txt
69+
# other_options: --bug-hunting --verbose
70+
71+
# - name: Show cppcheck report
72+
# run: |
73+
# cat cppcheck_report.txt
74+
75+
- name: Build Debian package
76+
shell: bash -l {0}
77+
run: |
78+
cd build
79+
cpack -G DEB
80+
81+
- name: Debian package as artifact
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: fastder
85+
path: build/*.deb
86+
# files: build/*.deb
87+
88+
- name: Clean previous build
89+
run: rm -rf build
90+
91+
- name: Build Conda package
92+
shell: bash -l {0}
93+
run: |
94+
conda-build conda/recipe
95+
96+
- name: Conda package as artifact
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: conda-package
100+
path: /usr/share/miniconda3/conda-bld/*/*.tar.bz2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ afe_data/
77
afe_data_param_tuning/
88
build/
99
dataset1/
10+
.idea/
11+
cpp/.idea/

.idea/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

.idea/editor.xml

Lines changed: 0 additions & 344 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.idea/mls.iml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
1+
option(CONDA_BUILD "Building inside conda-build" OFF)
2+
13
cmake_minimum_required(VERSION 4.0)
24
project(mls)
35

46
set(CMAKE_CXX_STANDARD 20)
57
set(CMAKE_CXX_STANDARD_REQUIRED ON)
68

9+
find_package(Threads REQUIRED)
10+
711
include_directories(cpp)
812

913
add_library(mls_lib
1014
cpp/Averager.cpp
11-
cpp/Averager.h
1215
cpp/BedGraphRow.cpp
13-
cpp/BedGraphRow.h
1416
# cpp/integrate_sj.cpp
1517
cpp/Parser.cpp
16-
cpp/Parser.h
1718
cpp/SJRow.cpp
18-
cpp/SJRow.h
1919
cpp/StitchedER.cpp
20-
cpp/StitchedER.h
2120
cpp/Integrator.cpp
22-
cpp/Integrator.h
2321
cpp/GTFRow.cpp
24-
cpp/GTFRow.h
25-
26-
2722
)
2823

2924

3025
add_executable(mls
3126
cpp/main.cpp
3227
)
33-
target_link_libraries(mls PRIVATE mls_lib)
28+
29+
target_link_libraries(mls PRIVATE mls_lib Threads::Threads)
3430

3531
enable_testing()
36-
add_subdirectory(tests)
32+
33+
if(NOT CONDA_BUILD)
34+
add_subdirectory(tests)
35+
endif()
36+
37+
# packaging
38+
set(CPACK_PACKAGE_NAME "fastder")
39+
set(CPACK_PACKAGE_VENDOR "Martina Lehmann")
40+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "fastder, a fast expressed regions finder")
41+
set(CPACK_PACKAGE_VERSION "0.0.1")
42+
set(CPACK_PACKAGE_CONTACT "martina.lavanya@gmail.com")
43+
44+
# Debian-specific packaging settings
45+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Martina Lehmann")
46+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libstdc++6")
47+
48+
include(CPack)

0 commit comments

Comments
 (0)