-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from eseiler/infra/install
[INFRA] install target and cpack
- Loading branch information
Showing
7 changed files
with
167 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin | ||
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Install | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
types: | ||
- unlabeled | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: install-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: ${{ github.event_name != 'push' }} | ||
|
||
env: | ||
TZ: Europe/Berlin | ||
|
||
defaults: | ||
run: | ||
shell: bash -Eexuo pipefail {0} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: ${{ matrix.compiler }} | ||
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
compiler: ["clang-18", "gcc-14"] | ||
container: | ||
image: ghcr.io/seqan/${{ matrix.compiler }} | ||
volumes: | ||
- /home/runner:/home/runner | ||
options: --privileged | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create source package | ||
run: | | ||
mkdir package && cd package | ||
cmake .. -DCMAKE_BUILD_TYPE=Release \ | ||
-Dneedle_PACKAGE=ON \ | ||
-Dneedle_TEST=OFF | ||
make package_source | ||
mkdir ../unpacked | ||
tar xf needle-*.tar.xz -C ../unpacked --strip-components=1 | ||
- name: Install from source package | ||
run: | | ||
mkdir build && cd build | ||
unshare -r -n cmake ../unpacked -DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \ | ||
-Dneedle_TEST=OFF | ||
make install | ||
- name: Run tests | ||
working-directory: build | ||
run: ./install/bin/needle --help | ||
|
||
- name: Upload source package | ||
if: matrix.compiler == 'gcc-14' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: source-package | ||
path: package/needle-*.tar.xz* | ||
retention-days: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin | ||
# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
# Only if creating the source package (`make package_source`). | ||
if (CPACK_SOURCE_INSTALLED_DIRECTORIES) | ||
file (COPY "@CPM_SOURCE_CACHE@" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin | ||
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
## PACKAGE | ||
# Change version in this file: project (needle VERSION x.x.x) | ||
# Change version in src/main.cpp: parser.info.version = "x.x.x"; | ||
# No dependencies should be locally installed. | ||
# To package, create a clean directory: | ||
# | ||
# mkdir needle-package | ||
# cd needle-package | ||
# git clone https://github.com/seqan/needle | ||
# cd needle | ||
# cd ../../../ | ||
# mkdir package | ||
# cd package | ||
# cmake ../needle | ||
# cmake --build . --target package_source | ||
# | ||
# Will create needle-[VERSION]-Source.tar.xz{,.sha256}. | ||
|
||
cmake_minimum_required (VERSION 3.7...3.30) | ||
|
||
set (CPACK_GENERATOR "TXZ") | ||
|
||
set (CPACK_PACKAGE_VERSION "${needle_VERSION}") | ||
set (CPACK_PACKAGE_VENDOR "seqan") | ||
set (CPACK_PACKAGE_CHECKSUM "SHA256") | ||
set (CPACK_RESOURCE_FILE_LICENSE "${needle_SOURCE_DIR}/LICENSE.md") | ||
set (CPACK_RESOURCE_FILE_README "${needle_SOURCE_DIR}/README.md") | ||
|
||
# Already being called on source package, i.e. CPM is already downloaded. | ||
if (NOT CPM_DOWNLOAD_LOCATION) | ||
set (CPM_DOWNLOAD_LOCATION "${needle_SOURCE_DIR}/cmake/CPM.cmake") | ||
endif () | ||
|
||
configure_file ("${needle_SOURCE_DIR}/cmake/cpack_install.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cpack_install.cmake" | ||
@ONLY | ||
) | ||
set (CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/cpack_install.cmake") | ||
|
||
# Source Package | ||
set (CPACK_SOURCE_GENERATOR "TXZ") | ||
list (APPEND CPACK_SOURCE_IGNORE_FILES "/\.git($|/)") | ||
list (APPEND CPACK_SOURCE_IGNORE_FILES "/\.github/") | ||
list (APPEND CPACK_SOURCE_IGNORE_FILES "/\.vscode/") | ||
list (APPEND CPACK_SOURCE_IGNORE_FILES "/build/") | ||
|
||
include (CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters