Skip to content

add error message when combining float with normal error #345

add error message when combining float with normal error

add error message when combining float with normal error #345

Workflow file for this run

# Builds the stock synthesis executables for testing and distribution.
# for mac, linux, windows
# Runs on every push and PR (even draft PRs)
name: build-ss3
on:
push:
paths:
- '**.tpl'
- '**.sh'
workflow_dispatch:
jobs:
build-ss3:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest}
- {os: macos-12}
- {os: macos-14}
- {os: ubuntu-latest}
# Limit run time to 90 min to avoid wasting action minutes.
# was set to 15 and then 30 minutes previously, but compiling admb
# on mac took too long
timeout-minutes: 90
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Update Ubuntu packages
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt-get update
# - name: Get admb and put in path, windows
# if: matrix.config.os == 'windows-latest'
# run: |
# Invoke-WebRequest -Uri https://github.com/admb-project/admb/releases/download/admb-13.1/admb-13.1b-windows.zip -OutFile "D:\a\ss3-source-code\ss3-source-code\admb-13.1.zip"
# Expand-Archive -LiteralPath "D:\a\ss3-source-code\ss3-source-code\admb-13.1.zip" -DestinationPath "D:\a\ss3-source-code\ss3-source-code\"
# echo "D:\a\ss3-source-code\ss3-source-code\admb-13.1\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# - name: checkout admb, mac
# if: matrix.config.os == 'macos-latest'
# uses: actions/checkout@v3
# with:
# repository: admb-project/admb
# path: admb
# ref: admb-13.1
# - name: clean, mac
# if: matrix.config.os == 'macos-latest'
# run: cd admb && make clean
# - name: see where admb is, mac
# if: matrix.config.os == 'macos-latest'
# run: |
# ls
# cd admb && ls
# - name: compile admb, mac
# if: matrix.config.os == 'macos-latest'
# run: |
# cd admb && make
# - name: see where admb is, mac
# if: matrix.config.os == 'macos-latest'
# run: |
# cd admb && ls -l
# - name: put admb in path, mac
# if: matrix.config.os == 'macos-latest'
# run: |
# sudo mv admb /usr/local/bin
# sudo chmod 755 /usr/local/bin/admb
# echo "/usr/local/bin/admb" >> $GITHUB_PATH
# - name: Get admb and put in path, linux
# if: matrix.config.os == 'ubuntu-latest'
# run: |
# wget https://github.com/admb-project/admb/releases/download/admb-13.1/admb-13.1-linux.zip
# sudo unzip admb-13.1-linux.zip -d /usr/local/bin
# sudo chmod 755 /usr/local/bin/admb-13.1/bin/admb
# echo "/usr/local/bin/admb-13.1/bin" >> $GITHUB_PATH
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Fetch tags
run: |
git fetch --tags
git fetch --prune --unshallow || true
- name: Get the last tag on windows
id: get-latest-tag-win
if: matrix.config.os == 'windows-latest'
run: |
git tag
$latest_tag = (git describe --abbrev=0 --tags)
$latest_tag_commit = ( git rev-list -n 1 $latest_tag)
$latest_commit = (git rev-list HEAD -n 1)
echo "tag=${latest_tag}" >> $env:GITHUB_OUTPUT
echo "tag_commit=${latest_tag_commit}" >> $env:GITHUB_OUTPUT
echo "commit=${latest_commit}" >> $env:GITHUB_OUTPUT
# uses: actions-ecosystem/action-get-latest-tag@v1 # for linux
- name: pull the last tag value to use in the Rscript on windows
id: get-version-win
if: matrix.config.os == 'windows-latest'
run: |
Out-File -InputObject ${{ steps.get-latest-tag-win.outputs.tag }} -FilePath .github/last_tag.txt
Out-File -InputObject ${{ steps.get-latest-tag-win.outputs.tag_commit }} -FilePath .github/last_tag_commit.txt
Out-File -InputObject ${{ steps.get-latest-tag-win.outputs.commit}} -FilePath .github/last_commit.txt
- name: Get the last tag on unix
id: get-latest-tag-unix
if: matrix.config.os == 'macos-12' || matrix.config.os == 'macos-14' || matrix.config.os == 'ubuntu-latest'
run: |
git tag
latest_tag=$(git describe --abbrev=0 --tags)
latest_tag_commit=$(git rev-list -n 1 $latest_tag)
latest_commit=$(git rev-list HEAD -n 1)
echo "tag=${latest_tag}" >> $GITHUB_OUTPUT
echo "tag_commit=${latest_tag_commit}" >> $GITHUB_OUTPUT
echo "commit=${latest_commit}" >> $GITHUB_OUTPUT
# uses: actions-ecosystem/action-get-latest-tag@v1 # for linux
- name: pull the last tag value to use in the Rscript on unix
id: get-version-unix
if: matrix.config.os == 'macos-12' || matrix.config.os == 'macos-14' || matrix.config.os == 'ubuntu-latest'
run: |
echo "${{ steps.get-latest-tag-unix.outputs.tag }}" > .github/last_tag.txt
echo "${{ steps.get-latest-tag-unix.outputs.tag_commit }}" > .github/last_tag_commit.txt
echo "${{ steps.get-latest-tag-unix.outputs.commit }}" > .github/last_commit.txt
- name: Edit the version info for safe version using R code
run: |
# Get the version
# get the last tag from the repository
tag_label <- readLines(".github/last_tag.txt")
# get commits from from the repository
tag_commit <- readLines(".github/last_tag_commit.txt")
last_commit <- readLines(".github/last_commit.txt")
message("The tag_label is ", tag_label)
if (substr(tag_label, start = 1, stop = 6) == "v3.30.") {
ver_num_full <- strsplit(tag_label, split = "v3.30", fixed = TRUE)[[1]][2]
ver_num <- strsplit(ver_num_full, split = ".", fixed = TRUE)[[1]][2]
if(length(grep("-", ver_num)) > 0) {
ver_num <- strsplit(ver_num, split = "-", fixed = TRUE)[[1]][1]
}
} else {
ver_num <- "unknown"
}
message("tag commit: ", tag_commit)
message("last commit: ", last_commit)
if(tag_commit == last_commit) {
# figure out the version using the tag
if(ver_num == "unknown") {
fix_ver_num <- "unknown"
} else {
ver_num_full_split <- strsplit(ver_num_full, split = ".", fixed = TRUE)[[1]]
if(length(ver_num_full_split) == 3) {
fix_ver_num <- ver_num_full_split[3]
} else if(length(ver_num_full_split) == 2) {
if(length(grep("-", ver_num_full_split, fixed = TRUE)) > 0) {
fix_ver_num <- strsplit(ver_num_full_split[2], split = "-", fixed = TRUE)[[1]][2]
fix_ver_num <- paste0("00-", fix_ver_num)
} else {
fix_ver_num <- "00"
}
} else {
fix_ver_num <- "unknown"
}
}
} else {
fix_ver_num <- "beta: not an official version of SS"
}
message("The minor version label is ", ver_num)
message("The patch version label is ", fix_ver_num)
# add version numbers to files
# safe file
ver_info <- readLines("SS_versioninfo_330safe.tpl")
ver_info_start <- grep('Create string with version info', ver_info, fixed = TRUE)
ver_info[ver_info_start + 1] <-
gsub('\\.xx', paste0('\\.', ver_num), ver_info[ver_info_start + 1])
ver_info[ver_info_start + 1] <-
gsub('\\.yy', paste0('\\.', fix_ver_num), ver_info[ver_info_start+1])
writeLines(ver_info, "SS_versioninfo_330safe.tpl")
#opt file
ver_info <- readLines("SS_versioninfo_330opt.tpl")
ver_info_start <- grep('Create string with version info', ver_info, fixed = TRUE)
ver_info[ver_info_start + 1] <-
gsub('\\.xx', paste0('\\.', ver_num), ver_info[ver_info_start + 1])
ver_info[ver_info_start + 1] <-
gsub('\\.yy', paste0('\\.', fix_ver_num), ver_info[ver_info_start+1])
writeLines(ver_info, "SS_versioninfo_330opt.tpl")
shell: Rscript {0}
- name: Build stock synthesis for windows with admb docker image
if: matrix.config.os == 'windows-latest'
run: |
cd Compile
./Make_SS_fast.bat || true
./Make_SS_safe.bat || true
cd ..
- name: Move exes to a new folder on windows
if: matrix.config.os == 'windows-latest'
run: |
mkdir SS330
chmod 777 SS330
mv Compile/ss3.exe SS330/
mv Compile/ss3_opt.exe SS330/
mv SS330/ss3.exe SS330/ss3_win.exe
mv SS330/ss3_opt.exe SS330/ss3_opt_win.exe
- name: Build stock synthesis for mac with admb docker image
if: matrix.config.os == 'macos-12'
run: |
brew install docker
colima start
docker pull johnoel/admb-13.2:linux
rm -rf SS330
rm -rf ss3_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o
colima stop
# Once macos-12 no longer is kept up by GitHub actions, we will have to
# build from source the macos-13 and the macos-14 x86_64 images to make versions
# compatible with x86_64 machines
- name: Build stock synthesis for mac m2 with admb docker image
if: matrix.config.os == 'macos-14'
run: |
brew update
brew install docker
brew install --head colima
colima start --arch x86_64
docker pull johnoel/admb-13.2:linux
rm -rf SS330
rm -rf ss3_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o
- name: Verify binary on mac
if: matrix.config.os == 'macos-12' || matrix.config.os == 'macos-14'
run: |
shasum -a 256 SS330/ss3
shasum -a 256 SS330/ss3_opt
- name: Delete unneeded files and change exe names on mac
if: matrix.config.os == 'macos-12' || matrix.config.os == 'macos-14'
run: |
cd SS330
rm *.obj *.htp *.cpp ss3_opt.tpl
mv ss3 ss3_osx
mv ss3_opt ss3_opt_osx
- name: Build stock synthesis for linux with p flag and admb docker image
if: matrix.config.os == 'ubuntu-latest'
run: |
rm -rf SS330
rm -rf ss3_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -p
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o -p
- name: Verify binary on linux
if: matrix.config.os == 'ubuntu-latest'
run: |
sha256sum SS330/ss3
sha256sum SS330/ss3_opt
- name: Delete unneeded files and change exe names on linux
if: matrix.config.os == 'ubuntu-latest'
run: |
cd SS330
rm *.obj *.htp *.cpp ss3_opt.tpl ss3.tpl
mv ss3 ss3_linux
mv ss3_opt ss3_opt_linux
- name: Archive binaries
if: success()
uses: actions/upload-artifact@main
with:
name: ss3-${{ matrix.config.os }}
path: SS330/