Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/parafeed_CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build-and-test:
runs-on: ubuntu-24.04
strategy:
matrix:
cxx_std: [11, 17]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake pkg-config bison flex libreadline-dev

- name: Configure CMake
run: |
cmake -S . -B build -DENABLE_TESTING=ON -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }}

- name: Build
run: |
cmake --build build -- -j$(nproc)

- name: Run tests
run: |
cd build
ctest --output-on-failure

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: parafeed-artifacts-cxx${{ matrix.cxx_std }}
path: build/

- name: Check for changes in spack_package
id: spack_changes
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^spack_package/'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Cache Spack clone
if: steps.spack_changes.outputs.changed == 'true'
uses: actions/cache@v4
with:
path: spack
key: spack-v0.23.1-${{ runner.os }}
restore-keys: |
spack-v0.23.1-

- name: Clone Spack v0.23.1
if: steps.spack_changes.outputs.changed == 'true' && steps.cache-spack.outputs.cache-hit != 'true'
run: |
git clone --branch v0.23.1 https://github.com/spack/spack.git

- name: Register local parafeed repo with Spack
if: steps.spack_changes.outputs.changed == 'true'
run: |
./spack/bin/spack repo add ./spack_package

- name: Create and activate and install Spack environment
if: steps.spack_changes.outputs.changed == 'true'
run: |
./spack/bin/spack env create parafeed-env
. ./spack/share/spack/setup-env.sh
spack env activate parafeed-env
spack add parafeed
spack concretize
spack install --jobs $(nproc)
spack env deactivate

- name: Skip Spack steps (no changes in spack_package)
if: steps.spack_changes.outputs.changed != 'true'
run: echo "No changes in spack_package, skipping Spack steps."
42 changes: 0 additions & 42 deletions .github/workflows/parafeed_CI.yml

This file was deleted.

45 changes: 45 additions & 0 deletions spack_package/packages/parafeed/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *
from spack.build_systems.cmake import CMakePackage

class Parafeed(CMakePackage):
"""Parafeed is a C++ library to parse and interact with the commandline."""

homepage = "https://github.com/sanbee/parafeed"
url = "https://github.com/sanbee/parafeed/archive/refs/tags/v1.1.41.tar.gz"

maintainers("preshanth", "sanbee", "sanbw")

# TODO: Check actual license in project. Replace "UNKNOWN" with actual SPDX identifier.
license("UNKNOWN", checked_by="sanbee")

version("1.1.41", sha256="a5cb034914cab8b661469f2f1aae6af7d88045d54f3535da8ff004a04cd8abd3")
version("1.1.4", sha256="9ca767aa1139516926456fff14fec466890caba5646e46f0553c7b648bb5510e")
version("1.1.2", sha256="74eb62034b0c4cbfd9a4a05872c10d568b184e8cf7543405d460fc0c52001139")
version("1.1.1", sha256="757290ec76b3762febbaadca4c597f9d668be55767dbcfdba305ddc48cb07689")

# Build-time and run-time dependencies
depends_on("readline")
depends_on("bison")
depends_on("flex")
depends_on("pkgconfig", type="build")
depends_on("cmake@3.1:", type="build")

# C++ standard variant
variant(
"cxxstd",
default="11",
values=("11", "14", "17", "20", "23"),
description="C++ standard to use"
)

def cmake_args(self):
args = [
self.define("CMAKE_CXX_STANDARD", self.spec.variants["cxxstd"].value),
self.define("CMAKE_CXX_STANDARD_REQUIRED", "ON"),
self.define("CMAKE_CXX_EXTENSIONS", "OFF")
]
return args
2 changes: 2 additions & 0 deletions spack_package/repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo:
namespace: parafeed