Skip to content

Commit a119640

Browse files
committed
updated workflows
1 parent dd4d20b commit a119640

File tree

3 files changed

+67
-19
lines changed

3 files changed

+67
-19
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ on:
44
push:
55
branches:
66
- main
7+
- master
78
pull_request:
89
branches:
910
- main
11+
- master
12+
13+
env:
14+
CTEST_OUTPUT_ON_FAILURE: 1
15+
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
1016

1117
jobs:
1218
build-and-test:
@@ -16,26 +22,51 @@ jobs:
1622
- name: Check out repository
1723
uses: actions/checkout@v3
1824

25+
- name: Load cache
26+
uses: actions/cache@v3
27+
with:
28+
path: "**/cpm_modules"
29+
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
30+
1931
# ---------------------------
2032
# Part 1: C++ Build & CTest
2133
# ---------------------------
2234

2335
- name: Install C++ build dependencies
2436
run: |
2537
sudo apt-get update -y
26-
sudo apt-get install -y build-essential cmake git python3-dev python3-pip
38+
sudo apt-get install -y \
39+
build-essential \
40+
cmake \
41+
git \
42+
libcurl4-openssl-dev \
43+
python3-dev \
44+
python3-pip
2745
28-
- name: Configure and build C++ code
46+
- name: Build and install C++ tool
2947
run: |
3048
cd cpp
31-
cmake -S standalone -B build/standalone -DCMAKE_BUILD_TYPE=Release
32-
cmake --build build/standalone
49+
cmake \
50+
-S . \
51+
-B build \
52+
-DCMAKE_BUILD_TYPE=Release
53+
cmake \
54+
--build build \
55+
--target install
3356
34-
- name: Run C++ unit tests with CTest
57+
- name: Build and Run C++ tool unit tests
3558
run: |
36-
cmake -S test -B build/test
37-
cmake --build build/test
38-
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test
59+
cmake \
60+
-S test \
61+
-B build/test \
62+
-DTEST_INSTALLED_VERSION=1
63+
cmake \
64+
--build build/test \
65+
--config Debug \
66+
-j4
67+
cmake \
68+
--build build/test \
69+
--target test
3970
4071
# -----------------------------
4172
# Part 2: Python install & tests

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ COPY . .
2121
RUN pip3 install --upgrade pip setuptools scikit-build
2222

2323
# 4) Manually configure, compile, and test the C++ code
24-
# This builds 'linecount' and 'test_linecount', then runs CTest.
25-
RUN mkdir build && cd build \
24+
# This builds 'Aligncount' and 'AligncountTests', then runs CTest.
25+
RUN cd cpp && mkdir build && cd build \
2626
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
2727
&& cmake --build . --parallel $(nproc) \
2828
&& ctest --output-on-failure

conda-recipe/meta.yaml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,52 @@ build:
2222
script: |
2323
2424
# Configure & compile
25-
cmake -S standalone -B build/standalone -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release
26-
cmake --build build/standalone --parallel ${CPU_COUNT:-1}
25+
cd cpp
26+
cmake \
27+
-S standalone \
28+
-B build/standalone \
29+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
30+
-DCMAKE_BUILD_TYPE=Release
31+
cmake \
32+
--build build/standalone \
33+
--parallel ${CPU_COUNT:-1}
2734
2835
# Run C++ unit tests (fail the build if any test fails)
29-
cmake -S test -B build/test
30-
cmake --build build/test
31-
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test
36+
cmake \
37+
-S test \
38+
-B build/test
39+
cmake \
40+
--build build/test
41+
CTEST_OUTPUT_ON_FAILURE=1 cmake \
42+
--build build/test \
43+
--target test
3244
3345
# install the cpp exe
34-
cmake --install . --prefix $PREFIX
46+
cmake \
47+
--install . \
48+
--prefix $PREFIX
3549
3650
number: 0
3751

3852
requirements:
3953
build:
54+
- {{ compiler('c') }}
4055
- {{ compiler("cxx") }}
4156
- cmake
4257
host:
4358
# This environment only needs to run CMake and the C++ compiler
59+
- {{ compiler('c') }}
4460
- {{ compiler("cxx") }}
4561
- cmake
4662

4763
outputs:
4864
# ---------------------------------------------------------
4965
# Output #1: Arch‐specific C++ executable (aligncount-cpp)
5066
# ---------------------------------------------------------
51-
- name: aligncount_cpp
67+
- name: Aligncount
5268
requirements:
5369
host:
70+
- {{ compiler('c') }}
5471
- {{ compiler("cxx") }}
5572
- cmake
5673
run:
@@ -60,7 +77,7 @@ outputs:
6077
# ---------------------------------------------------------
6178
# Output #2: Noarch Python wrapper (aligncount_demo)
6279
# ---------------------------------------------------------
63-
- name: aligncount
80+
- name: Aligncount_wrapper
6481
build:
6582
noarch: python
6683
script: |
@@ -80,7 +97,7 @@ outputs:
8097
- setuptools
8198
run:
8299
- python >=3.9,<3.14
83-
- {{ pin_subpackage("aligncount_cpp", exact=False) }}
100+
- {{ pin_subpackage("Aligncount", exact=False) }}
84101

85102
test:
86103
requires:

0 commit comments

Comments
 (0)