From 4606199760b959e582507ee91874f162cbdb6158 Mon Sep 17 00:00:00 2001 From: antonio-leblanc Date: Wed, 23 Apr 2025 08:15:51 -0300 Subject: [PATCH 1/4] better badges --- .gitattributes | 1 + .github/workflows/macos.yml | 2 +- .github/workflows/main.yml | 2 +- README.md | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 30c8078b..1afd67d3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ *.ipynb linguist-detectable=false *.ref filter=lfs diff=lfs merge=lfs -text * text=auto +*.sh text eol=lf diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0f87fc00..8c9a0385 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: Build ForeFire on macOS +name: macOS on: push: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a4ef8e0..dcfcc7ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build and Test on Ubuntu +name: Linux on: push: diff --git a/README.md b/README.md index 10f3d7a6..7a4fa7a9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ --- [![DOI](https://img.shields.io/badge/DOI-10.14195/978--989--26--0884--6_29-blue)](https://www.researchgate.net/publication/278769168_ForeFire_open-source_code_for_wildland_fire_spread_models) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -[![CI](https://github.com/forefireAPI/firefront/actions/workflows/main.yml/badge.svg)](https://github.com/forefireAPI/firefront/actions/workflows/main.yml) +[![linuxCI](https://github.com/forefireAPI/firefront/actions/workflows/main.yml/badge.svg)](https://github.com/forefireAPI/firefront/actions/workflows/main.yml) +[![macOSCI](https://github.com/forefireAPI/firefront/actions/workflows/macos.yml/badge.svg)](https://github.com/forefireAPI/firefront/actions/workflows/macos.yml) ![Language](https://img.shields.io/badge/C++-00599C?logo=c%2B%2B&logoColor=white) ![Language](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) [![Documentation Status](https://readthedocs.org/projects/your-rtd-project-name/badge/?version=latest)](https://your-rtd-project-name.readthedocs.io/en/latest/?badge=latest) From bbbb51a946b229ea941be7706d95892f8d4d5604 Mon Sep 17 00:00:00 2001 From: antonio-leblanc Date: Wed, 23 Apr 2025 13:28:31 -0300 Subject: [PATCH 2/4] faster build with build in parallel options --- cmake-build.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmake-build.sh b/cmake-build.sh index a67337d4..df8f116b 100644 --- a/cmake-build.sh +++ b/cmake-build.sh @@ -1,4 +1,11 @@ -mkdir build -cd build -cmake ../ -make \ No newline at end of file +#!/usr/bin/env bash +set -e + +# 1. Create (or reuse) the build directory quietly +mkdir -p build + +# 2. Configure into build/ +cmake -S . -B build + +# 3. Build in parallel on all cores +cmake --build build -- -j"$(nproc)" From 90625ffc340ddeccc4ed16077a107aee97d26143 Mon Sep 17 00:00:00 2001 From: antonio-leblanc Date: Wed, 23 Apr 2025 13:37:55 -0300 Subject: [PATCH 3/4] rm warnings --- src/MultiplicativeLayer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MultiplicativeLayer.h b/src/MultiplicativeLayer.h index 31774f06..35b27a62 100644 --- a/src/MultiplicativeLayer.h +++ b/src/MultiplicativeLayer.h @@ -93,9 +93,9 @@ template class MultiplicativeLayer : public DataLayer { double getOriginX( ){ return baseLayer->getOriginX(); }; double getOriginY(){ return baseLayer->getOriginY(); }; double getOriginZ(){ return baseLayer->getOriginZ(); }; - double getWidth(){ baseLayer->getWidth(); }; - double getHeight(){ baseLayer->getHeight(); }; - double getDepth(){ baseLayer->getDepth(); }; + double getWidth(){ return baseLayer->getWidth(); }; + double getHeight(){ return baseLayer->getHeight(); }; + double getDepth(){ return baseLayer->getDepth(); }; }; From a20d11e269a5f95849e4abc817ce1b50b69bb8a8 Mon Sep 17 00:00:00 2001 From: antonio-leblanc Date: Wed, 23 Apr 2025 13:53:18 -0300 Subject: [PATCH 4/4] fix ci installation --- .github/workflows/main.yml | 2 +- install-forefire.sh | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a4ef8e0..0be3950f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 - name: ForeFire build - run: sudo bash ./install-forefire.sh + run: sudo bash ./install-forefire.sh -y - name: Check version run: ./bin/forefire -v diff --git a/install-forefire.sh b/install-forefire.sh index c5878f18..9f847629 100644 --- a/install-forefire.sh +++ b/install-forefire.sh @@ -2,6 +2,21 @@ set -e IFS=$'\n\t' +# --- parse flags +AUTO_ANS=0 +while [[ $# -gt 0 ]]; do + case "$1" in + -y|--yes) + AUTO_ANS=1 + shift + ;; + *) + echo "Usage: $0 [-y|--yes]" >&2 + exit 1 + ;; + esac +done + echo -e "\n========= FOREFIRE INSTALLER ========" PROJECT_ROOT="$(pwd)" @@ -41,7 +56,12 @@ FOREFIREHOME_LINE="export FOREFIREHOME=\"$PROJECT_ROOT\"" if grep -qF "$BIN_PATH" "$CONFIG_FILE"; then echo "ForeFire already appears in your PATH in $CONFIG_FILE." else - read -p "Do you want to add ForeFire to your PATH permanently in $CONFIG_FILE? (y/n): " ans + if (( AUTO_ANS )); then + ans=y + else + read -p "Do you want to add ForeFire to your PATH permanently in $CONFIG_FILE? (y/n): " ans + fi + if echo "$ans" | grep -qi '^y'; then # Append a blank line, a comment, and the export line. echo "" >> "$CONFIG_FILE"