From a2b1ba20a9fcbedfb47adf7ea9c2a111376cd4d9 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 10:56:23 -0400 Subject: [PATCH 01/30] try fix to static build; add new workflow to test ss3 exe artifacts --- Make_SS_330_new.sh | 20 ++-- test-simple-with-ss3-artifacts.yml | 150 +++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 8 deletions(-) create mode 100644 test-simple-with-ss3-artifacts.yml diff --git a/Make_SS_330_new.sh b/Make_SS_330_new.sh index ae2743b7..d4d0b358 100755 --- a/Make_SS_330_new.sh +++ b/Make_SS_330_new.sh @@ -19,8 +19,9 @@ function usage() echo "" echo "Call this script as follows:" echo " ./Make_SS_330_new.sh [(-s | --source) source_dir] [(-b | --build) build_dir]" - echo " [(-a | --admb) admb_dir] [[-o | --opt] | [-f | --safe] [-p] " + echo " [(-a | --admb) admb_dir] [[-o | --opt] | [-f | --safe] [-p]" echo " [-w | --warn] [-d | --debug] [-h | --help]" + # build statically (full static) echo "Notes:" echo " -p is an ADMB flag to build statically and will be passed. " echo " -w re-compiles with common warnings enabled. " @@ -175,28 +176,31 @@ if [[ "$ADMB_HOME" == "docker" ]] ; then fi if [[ "$WARNINGS" == "on" ]] ; then if [[ "$WINDOWS10" == "true" ]] ; then - docker run --env CXXFLAGS="-Wall -Wextra" --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows10 $BUILD_TYPE.tpl + docker run --env CXXFLAGS="-Wall -Wextra" --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows10 $OPTFLAG $STATICFLAG $BUILD_TYPE.tpl else - docker run --env CXXFLAGS="-Wall -Wextra" --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows $BUILD_TYPE.tpl + docker run --env CXXFLAGS="-Wall -Wextra" --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows $OPTFLAG $STATICFLAG $BUILD_TYPE.tpl fi else if [[ "$WINDOWS10" == "true" ]] ; then - docker run --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows10 $BUILD_TYPE.tpl + docker run --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows10 $OPTFLAG $STATICFLAG $BUILD_TYPE.tpl else - docker run --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows $BUILD_TYPE.tpl + docker run --rm --mount source=`cygpath -w $PWD`\\$BUILD_DIR,destination=C:\\$BUILD_TYPE,mount=bind --workdir C:\\$BUILD_TYPE johnoel/admb-13.2:windows $OPTFLAG $STATICFLAG $BUILD_TYPE.tpl fi fi else if [[ "$WARNINGS" == "on" ]] ; then - docker run --env CXXFLAGS="-Wall -Wextra" --rm --mount source=$PWD/$BUILD_DIR,destination=/$BUILD_TYPE,type=bind --workdir /$BUILD_TYPE johnoel/admb-13.2:linux $BUILD_TYPE.tpl + export CXXFLAGS="-Wall -Wextra -static-libstdc++ -static-libgcc" else - docker run --rm --mount source=$PWD/$BUILD_DIR,destination=/$BUILD_TYPE,type=bind --workdir /$BUILD_TYPE johnoel/admb-13.2:linux $BUILD_TYPE.tpl + export CXXFLAGS="-static-libstdc++ -static-libgcc" fi + docker run --env CXXFLAGS="$CXXFLAGS" --rm --mount source=$PWD/$BUILD_DIR,destination=/$BUILD_TYPE,type=bind --workdir /$BUILD_TYPE johnoel/admb-13.2:linux $OPTFLAG $STATICFLAG $BUILD_TYPE.tpl fi else command pushd $BUILD_DIR > /dev/null if [[ "$WARNINGS" == "on" ]] ; then - export CXXFLAGS="-Wall -Wextra" + export CXXFLAGS="-Wall -Wextra -static-libstdc++ -static-libgcc" + else + export CXXFLAGS="-static-libstdc++ -static-libgcc" fi if [[ "$OS" == "Windows_NT" ]] ; then admb.sh $OPTFLAG $STATICFLAG $BUILD_TYPE diff --git a/test-simple-with-ss3-artifacts.yml b/test-simple-with-ss3-artifacts.yml new file mode 100644 index 00000000..70bc4f2b --- /dev/null +++ b/test-simple-with-ss3-artifacts.yml @@ -0,0 +1,150 @@ +on: + push: + paths: + - '**.tpl' + - '**.sh' + workflow_dispatch: + +jobs: + test-simple-model: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-latest] + include: + - os: ubuntu-latest + artifact_name: ss3-ubuntu-latest + exe_name: ss3_linux + - os: windows-latest + artifact_name: ss3-windows-latest + exe_name: ss3_win.exe + - os: macos-13 + artifact_name: ss3-macos-13 + exe_name: ss3_osx + - os: macos-latest + artifact_name: ss3-macos-latest + exe_name: ss3_osx + + steps: + - name: Checkout test repo (this repo) + uses: actions/checkout@v4 + + - name: Set up jq and unzip (Linux/macOS) + if: runner.os != 'Windows' + run: | + sudo apt-get update || true + sudo apt-get install -y jq unzip || brew install jq unzip + + - name: Set up jq (Windows) + if: runner.os == 'Windows' + run: choco install jq + + - name: Find latest successful ss3-build workflow run in nmfs-ost/ss3-source-code + id: get_run + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { data: workflows } = await github.rest.actions.listRepoWorkflows({ + owner: "nmfs-ost", + repo: "ss3-source-code" + }); + const workflow = workflows.workflows.find(wf => wf.name === "ss3-build"); + if (!workflow) throw "Workflow 'ss3-build' not found."; + const { data: runs } = await github.rest.actions.listWorkflowRuns({ + owner: "nmfs-ost", + repo: "ss3-source-code", + workflow_id: workflow.id, + status: "success", + per_page: 1 + }); + if (!runs.workflow_runs.length) throw "No successful runs found for 'ss3-build'."; + core.setOutput("run_id", runs.workflow_runs[0].id); + + - name: List artifacts from ss3-build run + id: list_artifacts + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const run_id = ${{ steps.get_run.outputs.run_id }}; + const { data: artifacts } = await github.rest.actions.listWorkflowRunArtifacts({ + owner: "nmfs-ost", + repo: "ss3-source-code", + run_id + }); + core.setOutput("artifacts", JSON.stringify(artifacts.artifacts)); + + - name: Download artifact for this OS + id: download_artifact + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -e + mkdir -p ss3_artifacts + os_artifact="${{ matrix.artifact_name }}" + artifacts=$(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + found_id="" + for artifact in $artifacts; do + _jq() { + echo ${artifact} | base64 --decode | jq -r ${1} + } + name=$(_jq '.name') + id=$(_jq '.id') + if [[ "$name" == "$os_artifact" ]]; then + found_id="$id" + break + fi + done + if [ -z "$found_id" ]; then + echo "Artifact $os_artifact not found!" + exit 1 + fi + # Download the artifact + echo "Downloading artifact: $os_artifact" + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GH_TOKEN" \ + "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + + - name: Unzip SS3 executable + run: | + cd ss3_artifacts + if [ "${{ runner.os }}" = "Windows" ]; then + powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ." + else + unzip -o "${{ matrix.artifact_name }}.zip" + fi + + - name: Checkout test models repository + uses: actions/checkout@v4 + with: + repository: nmfs-ost/ss3-test-models + path: ss3-test-models + + - name: Copy SS3 executable to simple model directory + run: | + exe="${{ matrix.exe_name }}" + src="ss3_artifacts/$exe" + dest="ss3-test-models/models/simple/$exe" + if [ "${{ runner.os }}" = "Windows" ]; then + cp "$src" "$dest" + else + cp "$src" "$dest" + chmod +x "$dest" + fi + + - name: Run SS3 on simple model + run: | + cd ss3-test-models/models/simple + if [ "${{ runner.os }}" = "Windows" ]; then + .\${{ matrix.exe_name }} + else + ./${{ matrix.exe_name }} + fi + + - name: Archive simple model output + uses: actions/upload-artifact@v4 + with: + name: simple-model-output-${{ matrix.os }} + path: ss3-test-models/models/simple/ \ No newline at end of file From 65377daaabc5b55d27f18a475d15ad04b747ff11 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 11:08:57 -0400 Subject: [PATCH 02/30] move workflow of test to right place --- .../workflows/test-simple-with-ss3-artifacts.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test-simple-with-ss3-artifacts.yml => .github/workflows/test-simple-with-ss3-artifacts.yml (100%) diff --git a/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml similarity index 100% rename from test-simple-with-ss3-artifacts.yml rename to .github/workflows/test-simple-with-ss3-artifacts.yml From b64992be1e592fe4b8d436484eeabf45ffc337ed Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 11:36:12 -0400 Subject: [PATCH 03/30] comment out push paths to test workflow on push --- .github/workflows/test-simple-with-ss3-artifacts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 70bc4f2b..4fd6af48 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -1,8 +1,8 @@ on: push: - paths: - - '**.tpl' - - '**.sh' + # paths: + # - '**.tpl' + # - '**.sh' workflow_dispatch: jobs: From acea26a38bf99f8ffb7b7119ab6e402e5c5d07f8 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 11:40:27 -0400 Subject: [PATCH 04/30] fix build-ss3 name --- .github/workflows/test-simple-with-ss3-artifacts.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 4fd6af48..7aa3d26d 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -39,7 +39,7 @@ jobs: if: runner.os == 'Windows' run: choco install jq - - name: Find latest successful ss3-build workflow run in nmfs-ost/ss3-source-code + - name: Find latest successful build-ss3 workflow run in nmfs-ost/ss3-source-code id: get_run uses: actions/github-script@v7 with: @@ -49,8 +49,8 @@ jobs: owner: "nmfs-ost", repo: "ss3-source-code" }); - const workflow = workflows.workflows.find(wf => wf.name === "ss3-build"); - if (!workflow) throw "Workflow 'ss3-build' not found."; + const workflow = workflows.workflows.find(wf => wf.name === "build-ss3"); + if (!workflow) throw "Workflow 'build-ss3' not found."; const { data: runs } = await github.rest.actions.listWorkflowRuns({ owner: "nmfs-ost", repo: "ss3-source-code", @@ -58,10 +58,10 @@ jobs: status: "success", per_page: 1 }); - if (!runs.workflow_runs.length) throw "No successful runs found for 'ss3-build'."; + if (!runs.workflow_runs.length) throw "No successful runs found for 'build-ss3'."; core.setOutput("run_id", runs.workflow_runs[0].id); - - name: List artifacts from ss3-build run + - name: List artifacts from build-ss3 run id: list_artifacts uses: actions/github-script@v7 with: From 81e512924e963a5ee4e38fd345643bab921fe030 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 12:02:15 -0400 Subject: [PATCH 05/30] fix capitalization of simple model --- .github/workflows/test-simple-with-ss3-artifacts.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 7aa3d26d..89279d85 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -122,11 +122,11 @@ jobs: repository: nmfs-ost/ss3-test-models path: ss3-test-models - - name: Copy SS3 executable to simple model directory + - name: Copy SS3 executable to Simple model directory run: | exe="${{ matrix.exe_name }}" src="ss3_artifacts/$exe" - dest="ss3-test-models/models/simple/$exe" + dest="ss3-test-models/models/Simple/$exe" if [ "${{ runner.os }}" = "Windows" ]; then cp "$src" "$dest" else @@ -134,17 +134,17 @@ jobs: chmod +x "$dest" fi - - name: Run SS3 on simple model + - name: Run SS3 on Simple model run: | - cd ss3-test-models/models/simple + cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then .\${{ matrix.exe_name }} else ./${{ matrix.exe_name }} fi - - name: Archive simple model output + - name: Archive Simple model output uses: actions/upload-artifact@v4 with: name: simple-model-output-${{ matrix.os }} - path: ss3-test-models/models/simple/ \ No newline at end of file + path: ss3-test-models/models/Simple/ \ No newline at end of file From 119587ede01de595d5d32a1bd1de7d5f5be0ba58 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 12:14:22 -0400 Subject: [PATCH 06/30] add shell command --- .github/workflows/test-simple-with-ss3-artifacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 89279d85..c1f856ad 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -77,6 +77,7 @@ jobs: - name: Download artifact for this OS id: download_artifact + shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 5dfc9d8dfd627f1d6e2f6ac203b750e46373708f Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 12:27:19 -0400 Subject: [PATCH 07/30] try fix for windows using bash --- .../test-simple-with-ss3-artifacts.yml | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index c1f856ad..eea3b01d 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -85,10 +85,14 @@ jobs: mkdir -p ss3_artifacts os_artifact="${{ matrix.artifact_name }}" artifacts=$(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + if [[ ${#artifacts[@]} -eq 0 ]]; then + echo "No artifacts found." + exit 1 + fi found_id="" - for artifact in $artifacts; do + for artifact in "${artifacts[@]}"; do _jq() { - echo ${artifact} | base64 --decode | jq -r ${1} + echo "${artifact}" | base64 --decode | jq -r "${1}" } name=$(_jq '.name') id=$(_jq '.id') @@ -109,6 +113,7 @@ jobs: "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Unzip SS3 executable + shell: bash run: | cd ss3_artifacts if [ "${{ runner.os }}" = "Windows" ]; then @@ -123,19 +128,21 @@ jobs: repository: nmfs-ost/ss3-test-models path: ss3-test-models + - name: Ensure Simple model directory exists + shell: bash + run: mkdir -p ss3-test-models/models/Simple + - name: Copy SS3 executable to Simple model directory + shell: bash run: | exe="${{ matrix.exe_name }}" src="ss3_artifacts/$exe" dest="ss3-test-models/models/Simple/$exe" - if [ "${{ runner.os }}" = "Windows" ]; then - cp "$src" "$dest" - else - cp "$src" "$dest" - chmod +x "$dest" - fi + cp "$src" "$dest" + chmod +x "$dest" || true - name: Run SS3 on Simple model + shell: bash run: | cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then From e57a3523a2bfbbdb1dc819cc7f02400a04c9b199 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 12:34:22 -0400 Subject: [PATCH 08/30] readarray fix --- .github/workflows/test-simple-with-ss3-artifacts.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index eea3b01d..9fbb8d28 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -84,11 +84,15 @@ jobs: set -e mkdir -p ss3_artifacts os_artifact="${{ matrix.artifact_name }}" - artifacts=$(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') if [[ ${#artifacts[@]} -eq 0 ]]; then echo "No artifacts found." exit 1 fi + echo "Available artifacts:" + for artifact in "${artifacts[@]}"; do + echo "${artifact}" | base64 --decode | jq -r '.name' + done found_id="" for artifact in "${artifacts[@]}"; do _jq() { From 24930e7f15b4334552e2bea134ac4237ddc9043c Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 12:52:38 -0400 Subject: [PATCH 09/30] fix bash for macos --- .../test-simple-with-ss3-artifacts.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 9fbb8d28..73a2d377 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -39,6 +39,14 @@ jobs: if: runner.os == 'Windows' run: choco install jq + - name: Use Bash 5 on macOS + if: runner.os == 'macOS' + run: brew install bash + + - name: Set SHELL to bash 5 on macOS + if: runner.os == 'macOS' + run: echo "/opt/homebrew/bin/bash" >> $GITHUB_PATH + - name: Find latest successful build-ss3 workflow run in nmfs-ost/ss3-source-code id: get_run uses: actions/github-script@v7 @@ -77,7 +85,7 @@ jobs: - name: Download artifact for this OS id: download_artifact - shell: bash + shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -117,7 +125,7 @@ jobs: "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Unzip SS3 executable - shell: bash + shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | cd ss3_artifacts if [ "${{ runner.os }}" = "Windows" ]; then @@ -133,11 +141,11 @@ jobs: path: ss3-test-models - name: Ensure Simple model directory exists - shell: bash + shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: mkdir -p ss3-test-models/models/Simple - name: Copy SS3 executable to Simple model directory - shell: bash + shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | exe="${{ matrix.exe_name }}" src="ss3_artifacts/$exe" @@ -146,7 +154,7 @@ jobs: chmod +x "$dest" || true - name: Run SS3 on Simple model - shell: bash + shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then From ef6b28242fa0122adc5c69d5959f300fe8757773 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 12:59:44 -0400 Subject: [PATCH 10/30] fix shell command --- .github/workflows/test-simple-with-ss3-artifacts.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 73a2d377..408049dc 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -85,7 +85,7 @@ jobs: - name: Download artifact for this OS id: download_artifact - shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -125,7 +125,7 @@ jobs: "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Unzip SS3 executable - shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | cd ss3_artifacts if [ "${{ runner.os }}" = "Windows" ]; then @@ -145,7 +145,7 @@ jobs: run: mkdir -p ss3-test-models/models/Simple - name: Copy SS3 executable to Simple model directory - shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | exe="${{ matrix.exe_name }}" src="ss3_artifacts/$exe" @@ -154,7 +154,7 @@ jobs: chmod +x "$dest" || true - name: Run SS3 on Simple model - shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then From 49ec8bd4a4d3a28536066c74a930ab08120ea014 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:00:46 -0400 Subject: [PATCH 11/30] fix shell command again --- .github/workflows/test-simple-with-ss3-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 408049dc..5c2445fb 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -141,7 +141,7 @@ jobs: path: ss3-test-models - name: Ensure Simple model directory exists - shell: shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: mkdir -p ss3-test-models/models/Simple - name: Copy SS3 executable to Simple model directory From 1a9c31601ffdb595c737e97ba8c08a0aad41a834 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:05:55 -0400 Subject: [PATCH 12/30] fix shell macos --- .../workflows/test-simple-with-ss3-artifacts.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 5c2445fb..6219cf8a 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -40,11 +40,11 @@ jobs: run: choco install jq - name: Use Bash 5 on macOS - if: runner.os == 'macOS' + if: startsWith(matrix.os, 'macos-') run: brew install bash - name: Set SHELL to bash 5 on macOS - if: runner.os == 'macOS' + if: startsWith(matrix.os, 'macos-') run: echo "/opt/homebrew/bin/bash" >> $GITHUB_PATH - name: Find latest successful build-ss3 workflow run in nmfs-ost/ss3-source-code @@ -85,7 +85,7 @@ jobs: - name: Download artifact for this OS id: download_artifact - shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -125,7 +125,7 @@ jobs: "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Unzip SS3 executable - shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | cd ss3_artifacts if [ "${{ runner.os }}" = "Windows" ]; then @@ -141,11 +141,11 @@ jobs: path: ss3-test-models - name: Ensure Simple model directory exists - shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: mkdir -p ss3-test-models/models/Simple - name: Copy SS3 executable to Simple model directory - shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | exe="${{ matrix.exe_name }}" src="ss3_artifacts/$exe" @@ -154,7 +154,7 @@ jobs: chmod +x "$dest" || true - name: Run SS3 on Simple model - shell: ${{ runner.os == 'macOS' && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} run: | cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then From c42f46798fdcb992b5c0c299c7bf1f6720461702 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:14:53 -0400 Subject: [PATCH 13/30] try fix again for mac --- .../test-simple-with-ss3-artifacts.yml | 54 +++++++++++++++++-- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 6219cf8a..9d8e2009 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -85,7 +85,8 @@ jobs: - name: Download artifact for this OS id: download_artifact - shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} + if: "!startsWith(matrix.os, 'macos-')" + shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -124,8 +125,51 @@ jobs: -H "Authorization: Bearer $GH_TOKEN" \ "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + - name: Download artifact for this OS mac + id: download_artifact + if: startsWith(matrix.os, 'macos-') + shell: /opt/homebrew/bin/bash {0} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -e + mkdir -p ss3_artifacts + os_artifact="${{ matrix.artifact_name }}" + readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + if [[ ${#artifacts[@]} -eq 0 ]]; then + echo "No artifacts found." + exit 1 + fi + echo "Available artifacts:" + for artifact in "${artifacts[@]}"; do + echo "${artifact}" | base64 --decode | jq -r '.name' + done + found_id="" + for artifact in "${artifacts[@]}"; do + _jq() { + echo "${artifact}" | base64 --decode | jq -r "${1}" + } + name=$(_jq '.name') + id=$(_jq '.id') + if [[ "$name" == "$os_artifact" ]]; then + found_id="$id" + break + fi + done + if [ -z "$found_id" ]; then + echo "Artifact $os_artifact not found!" + exit 1 + fi + # Download the artifact + echo "Downloading artifact: $os_artifact" + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GH_TOKEN" \ + "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + + - name: Unzip SS3 executable - shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: bash run: | cd ss3_artifacts if [ "${{ runner.os }}" = "Windows" ]; then @@ -141,11 +185,11 @@ jobs: path: ss3-test-models - name: Ensure Simple model directory exists - shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: bash run: mkdir -p ss3-test-models/models/Simple - name: Copy SS3 executable to Simple model directory - shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: bash run: | exe="${{ matrix.exe_name }}" src="ss3_artifacts/$exe" @@ -154,7 +198,7 @@ jobs: chmod +x "$dest" || true - name: Run SS3 on Simple model - shell: ${{ startsWith(matrix.os, 'macos-') && '/opt/homebrew/bin/bash {0}' || 'bash' }} + shell: bash run: | cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then From 7ef583eafba9d0a9164ef351d2b49e849a307291 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:16:55 -0400 Subject: [PATCH 14/30] unique id --- .github/workflows/test-simple-with-ss3-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 9d8e2009..c35cd4ac 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -126,7 +126,7 @@ jobs: "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Download artifact for this OS mac - id: download_artifact + id: download_artifact-mac if: startsWith(matrix.os, 'macos-') shell: /opt/homebrew/bin/bash {0} env: From 00141363a8056d2862032d4b8d8eb2ba26ddc83a Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:26:54 -0400 Subject: [PATCH 15/30] try different mac ones --- .../test-simple-with-ss3-artifacts.yml | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index c35cd4ac..26b58204 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -43,9 +43,9 @@ jobs: if: startsWith(matrix.os, 'macos-') run: brew install bash - - name: Set SHELL to bash 5 on macOS - if: startsWith(matrix.os, 'macos-') - run: echo "/opt/homebrew/bin/bash" >> $GITHUB_PATH + # - name: Set SHELL to bash 5 on macOS + # if: startsWith(matrix.os, 'macos-') + # run: echo "/opt/homebrew/bin/bash" >> $GITHUB_PATH - name: Find latest successful build-ss3 workflow run in nmfs-ost/ss3-source-code id: get_run @@ -126,8 +126,8 @@ jobs: "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Download artifact for this OS mac - id: download_artifact-mac - if: startsWith(matrix.os, 'macos-') + id: download_artifact-mac-silicon + if: runner.os == 'macos-latest' shell: /opt/homebrew/bin/bash {0} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -167,7 +167,47 @@ jobs: -H "Authorization: Bearer $GH_TOKEN" \ "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - + - name: Download artifact for this OS mac + id: download_artifact-mac-intel + if: runner.os == 'macos-13' + shell: /opt/homebrew/bin/bash {0} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -e + mkdir -p ss3_artifacts + os_artifact="${{ matrix.artifact_name }}" + readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + if [[ ${#artifacts[@]} -eq 0 ]]; then + echo "No artifacts found." + exit 1 + fi + echo "Available artifacts:" + for artifact in "${artifacts[@]}"; do + echo "${artifact}" | base64 --decode | jq -r '.name' + done + found_id="" + for artifact in "${artifacts[@]}"; do + _jq() { + echo "${artifact}" | base64 --decode | jq -r "${1}" + } + name=$(_jq '.name') + id=$(_jq '.id') + if [[ "$name" == "$os_artifact" ]]; then + found_id="$id" + break + fi + done + if [ -z "$found_id" ]; then + echo "Artifact $os_artifact not found!" + exit 1 + fi + # Download the artifact + echo "Downloading artifact: $os_artifact" + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GH_TOKEN" \ + "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Unzip SS3 executable shell: bash run: | From 1da0fb909cfe2bc03931fcc35c709cac9119d400 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:27:27 -0400 Subject: [PATCH 16/30] different shell for macos 13 --- .github/workflows/test-simple-with-ss3-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 26b58204..d1a4675b 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -170,7 +170,7 @@ jobs: - name: Download artifact for this OS mac id: download_artifact-mac-intel if: runner.os == 'macos-13' - shell: /opt/homebrew/bin/bash {0} + shell: /usr/local/bin/bash {0} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 0c4287e41cb613d004aceba4f50e461b6dd51f88 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:32:47 -0400 Subject: [PATCH 17/30] try again --- .../test-simple-with-ss3-artifacts.yml | 252 +++++++++--------- 1 file changed, 130 insertions(+), 122 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index d1a4675b..09069e36 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -85,7 +85,7 @@ jobs: - name: Download artifact for this OS id: download_artifact - if: "!startsWith(matrix.os, 'macos-')" + # if: "!startsWith(matrix.os, 'macos-')" shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -93,130 +93,138 @@ jobs: set -e mkdir -p ss3_artifacts os_artifact="${{ matrix.artifact_name }}" - readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') - if [[ ${#artifacts[@]} -eq 0 ]]; then - echo "No artifacts found." - exit 1 - fi - echo "Available artifacts:" - for artifact in "${artifacts[@]}"; do - echo "${artifact}" | base64 --decode | jq -r '.name' - done - found_id="" - for artifact in "${artifacts[@]}"; do - _jq() { - echo "${artifact}" | base64 --decode | jq -r "${1}" - } - name=$(_jq '.name') - id=$(_jq '.id') - if [[ "$name" == "$os_artifact" ]]; then - found_id="$id" - break - fi - done - if [ -z "$found_id" ]; then - echo "Artifact $os_artifact not found!" - exit 1 - fi - # Download the artifact - echo "Downloading artifact: $os_artifact" - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GH_TOKEN" \ - "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - - - name: Download artifact for this OS mac - id: download_artifact-mac-silicon - if: runner.os == 'macos-latest' - shell: /opt/homebrew/bin/bash {0} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -e - mkdir -p ss3_artifacts - os_artifact="${{ matrix.artifact_name }}" - readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') - if [[ ${#artifacts[@]} -eq 0 ]]; then - echo "No artifacts found." - exit 1 + if [[ "${{ matrix.os }}" == "macos-13" ]]; then + BASH_PATH="/usr/local/bin/bash" + elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then + BASH_PATH="/opt/homebrew/bin/bash" + else + BASH_PATH="bash" fi - echo "Available artifacts:" - for artifact in "${artifacts[@]}"; do - echo "${artifact}" | base64 --decode | jq -r '.name' - done - found_id="" - for artifact in "${artifacts[@]}"; do - _jq() { - echo "${artifact}" | base64 --decode | jq -r "${1}" - } - name=$(_jq '.name') - id=$(_jq '.id') - if [[ "$name" == "$os_artifact" ]]; then - found_id="$id" - break + $BASH_PATH -c ' + readarray -t artifacts < <(echo "${{ steps.list_artifacts.outputs.artifacts }}" | jq -r ".[] | @base64") + if [[ ${#artifacts[@]} -eq 0 ]]; then + echo "No artifacts found." + exit 1 fi - done - if [ -z "$found_id" ]; then - echo "Artifact $os_artifact not found!" - exit 1 - fi - # Download the artifact - echo "Downloading artifact: $os_artifact" - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GH_TOKEN" \ - "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - - - name: Download artifact for this OS mac - id: download_artifact-mac-intel - if: runner.os == 'macos-13' - shell: /usr/local/bin/bash {0} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -e - mkdir -p ss3_artifacts - os_artifact="${{ matrix.artifact_name }}" - readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') - if [[ ${#artifacts[@]} -eq 0 ]]; then - echo "No artifacts found." - exit 1 - fi - echo "Available artifacts:" - for artifact in "${artifacts[@]}"; do - echo "${artifact}" | base64 --decode | jq -r '.name' - done - found_id="" - for artifact in "${artifacts[@]}"; do - _jq() { - echo "${artifact}" | base64 --decode | jq -r "${1}" - } - name=$(_jq '.name') - id=$(_jq '.id') - if [[ "$name" == "$os_artifact" ]]; then - found_id="$id" - break + echo "Available artifacts:" + for artifact in "${artifacts[@]}"; do + echo "${artifact}" | base64 --decode | jq -r ".name" + done + found_id="" + for artifact in "${artifacts[@]}"; do + _jq() { + echo "${artifact}" | base64 --decode | jq -r "${1}" + } + name=$(_jq ".name") + id=$(_jq ".id") + if [[ "$name" == "${os_artifact}" ]]; then + found_id="$id" + break + fi + done + if [ -z "$found_id" ]; then + echo "Artifact ${os_artifact} not found!" + exit 1 fi - done - if [ -z "$found_id" ]; then - echo "Artifact $os_artifact not found!" - exit 1 - fi - # Download the artifact - echo "Downloading artifact: $os_artifact" - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GH_TOKEN" \ - "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - - name: Unzip SS3 executable - shell: bash - run: | - cd ss3_artifacts - if [ "${{ runner.os }}" = "Windows" ]; then - powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ." - else - unzip -o "${{ matrix.artifact_name }}.zip" - fi + echo "Downloading artifact: ${os_artifact}" + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GH_TOKEN" \ + "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/${os_artifact}.zip" + ' + + # - name: Download artifact for this OS mac + # id: download_artifact-mac-silicon + # if: runner.os == 'macos-latest' + # shell: /opt/homebrew/bin/bash {0} + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # set -e + # mkdir -p ss3_artifacts + # os_artifact="${{ matrix.artifact_name }}" + # readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + # if [[ ${#artifacts[@]} -eq 0 ]]; then + # echo "No artifacts found." + # exit 1 + # fi + # echo "Available artifacts:" + # for artifact in "${artifacts[@]}"; do + # echo "${artifact}" | base64 --decode | jq -r '.name' + # done + # found_id="" + # for artifact in "${artifacts[@]}"; do + # _jq() { + # echo "${artifact}" | base64 --decode | jq -r "${1}" + # } + # name=$(_jq '.name') + # id=$(_jq '.id') + # if [[ "$name" == "$os_artifact" ]]; then + # found_id="$id" + # break + # fi + # done + # if [ -z "$found_id" ]; then + # echo "Artifact $os_artifact not found!" + # exit 1 + # fi + # # Download the artifact + # echo "Downloading artifact: $os_artifact" + # gh api \ + # -H "Accept: application/vnd.github+json" \ + # -H "Authorization: Bearer $GH_TOKEN" \ + # "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + + # - name: Download artifact for this OS mac + # id: download_artifact-mac-intel + # if: runner.os == 'macos-13' + # shell: /usr/local/bin/bash {0} + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # set -e + # mkdir -p ss3_artifacts + # os_artifact="${{ matrix.artifact_name }}" + # readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') + # if [[ ${#artifacts[@]} -eq 0 ]]; then + # echo "No artifacts found." + # exit 1 + # fi + # echo "Available artifacts:" + # for artifact in "${artifacts[@]}"; do + # echo "${artifact}" | base64 --decode | jq -r '.name' + # done + # found_id="" + # for artifact in "${artifacts[@]}"; do + # _jq() { + # echo "${artifact}" | base64 --decode | jq -r "${1}" + # } + # name=$(_jq '.name') + # id=$(_jq '.id') + # if [[ "$name" == "$os_artifact" ]]; then + # found_id="$id" + # break + # fi + # done + # if [ -z "$found_id" ]; then + # echo "Artifact $os_artifact not found!" + # exit 1 + # fi + # # Download the artifact + # echo "Downloading artifact: $os_artifact" + # gh api \ + # -H "Accept: application/vnd.github+json" \ + # -H "Authorization: Bearer $GH_TOKEN" \ + # "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + # - name: Unzip SS3 executable + # shell: bash + # run: | + # cd ss3_artifacts + # if [ "${{ runner.os }}" = "Windows" ]; then + # powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ." + # else + # unzip -o "${{ matrix.artifact_name }}.zip" + # fi - name: Checkout test models repository uses: actions/checkout@v4 From 241a87d1a28942acf190a2cd81e8eef6e3d49262 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 13:38:09 -0400 Subject: [PATCH 18/30] try again --- .../test-simple-with-ss3-artifacts.yml | 168 ++++-------------- 1 file changed, 38 insertions(+), 130 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 09069e36..ce04232d 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -85,7 +85,6 @@ jobs: - name: Download artifact for this OS id: download_artifact - # if: "!startsWith(matrix.os, 'macos-')" shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -93,138 +92,47 @@ jobs: set -e mkdir -p ss3_artifacts os_artifact="${{ matrix.artifact_name }}" - if [[ "${{ matrix.os }}" == "macos-13" ]]; then - BASH_PATH="/usr/local/bin/bash" - elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then - BASH_PATH="/opt/homebrew/bin/bash" - else - BASH_PATH="bash" + ARTIFACTS_JSON='${{ steps.list_artifacts.outputs.artifacts }}' + echo "RAW ARTIFACTS OUTPUT:" + echo "$ARTIFACTS_JSON" + + if [ -z "$ARTIFACTS_JSON" ]; then + echo "No artifacts JSON found -- previous step may have failed." + exit 1 fi - $BASH_PATH -c ' - readarray -t artifacts < <(echo "${{ steps.list_artifacts.outputs.artifacts }}" | jq -r ".[] | @base64") - if [[ ${#artifacts[@]} -eq 0 ]]; then - echo "No artifacts found." - exit 1 - fi - echo "Available artifacts:" - for artifact in "${artifacts[@]}"; do - echo "${artifact}" | base64 --decode | jq -r ".name" - done - found_id="" - for artifact in "${artifacts[@]}"; do - _jq() { - echo "${artifact}" | base64 --decode | jq -r "${1}" - } - name=$(_jq ".name") - id=$(_jq ".id") - if [[ "$name" == "${os_artifact}" ]]; then - found_id="$id" - break - fi - done - if [ -z "$found_id" ]; then - echo "Artifact ${os_artifact} not found!" - exit 1 - fi - echo "Downloading artifact: ${os_artifact}" - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GH_TOKEN" \ - "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/${os_artifact}.zip" - ' - # - name: Download artifact for this OS mac - # id: download_artifact-mac-silicon - # if: runner.os == 'macos-latest' - # shell: /opt/homebrew/bin/bash {0} - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # set -e - # mkdir -p ss3_artifacts - # os_artifact="${{ matrix.artifact_name }}" - # readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') - # if [[ ${#artifacts[@]} -eq 0 ]]; then - # echo "No artifacts found." - # exit 1 - # fi - # echo "Available artifacts:" - # for artifact in "${artifacts[@]}"; do - # echo "${artifact}" | base64 --decode | jq -r '.name' - # done - # found_id="" - # for artifact in "${artifacts[@]}"; do - # _jq() { - # echo "${artifact}" | base64 --decode | jq -r "${1}" - # } - # name=$(_jq '.name') - # id=$(_jq '.id') - # if [[ "$name" == "$os_artifact" ]]; then - # found_id="$id" - # break - # fi - # done - # if [ -z "$found_id" ]; then - # echo "Artifact $os_artifact not found!" - # exit 1 - # fi - # # Download the artifact - # echo "Downloading artifact: $os_artifact" - # gh api \ - # -H "Accept: application/vnd.github+json" \ - # -H "Authorization: Bearer $GH_TOKEN" \ - # "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + IFS=$'\n' artifacts=($(echo "$ARTIFACTS_JSON" | jq -r '.[] | @base64')) + if [[ ${#artifacts[@]} -eq 0 ]]; then + echo "No artifacts found." + exit 1 + fi - # - name: Download artifact for this OS mac - # id: download_artifact-mac-intel - # if: runner.os == 'macos-13' - # shell: /usr/local/bin/bash {0} - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # set -e - # mkdir -p ss3_artifacts - # os_artifact="${{ matrix.artifact_name }}" - # readarray -t artifacts < <(echo '${{ steps.list_artifacts.outputs.artifacts }}' | jq -r '.[] | @base64') - # if [[ ${#artifacts[@]} -eq 0 ]]; then - # echo "No artifacts found." - # exit 1 - # fi - # echo "Available artifacts:" - # for artifact in "${artifacts[@]}"; do - # echo "${artifact}" | base64 --decode | jq -r '.name' - # done - # found_id="" - # for artifact in "${artifacts[@]}"; do - # _jq() { - # echo "${artifact}" | base64 --decode | jq -r "${1}" - # } - # name=$(_jq '.name') - # id=$(_jq '.id') - # if [[ "$name" == "$os_artifact" ]]; then - # found_id="$id" - # break - # fi - # done - # if [ -z "$found_id" ]; then - # echo "Artifact $os_artifact not found!" - # exit 1 - # fi - # # Download the artifact - # echo "Downloading artifact: $os_artifact" - # gh api \ - # -H "Accept: application/vnd.github+json" \ - # -H "Authorization: Bearer $GH_TOKEN" \ - # "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - # - name: Unzip SS3 executable - # shell: bash - # run: | - # cd ss3_artifacts - # if [ "${{ runner.os }}" = "Windows" ]; then - # powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ." - # else - # unzip -o "${{ matrix.artifact_name }}.zip" - # fi + echo "Available artifacts:" + for artifact in "${artifacts[@]}"; do + echo "${artifact}" | base64 --decode | jq -r '.name' + done + + found_id="" + for artifact in "${artifacts[@]}"; do + _jq() { + echo "${artifact}" | base64 --decode | jq -r "${1}" + } + name=$(_jq '.name') + id=$(_jq '.id') + if [[ "$name" == "$os_artifact" ]]; then + found_id="$id" + break + fi + done + if [ -z "$found_id" ]; then + echo "Artifact $os_artifact not found!" + exit 1 + fi + echo "Downloading artifact: $os_artifact" + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GH_TOKEN" \ + "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Checkout test models repository uses: actions/checkout@v4 From 3edcc2a482a7d05e9920d88a17c22ef4dba1691e Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 14:02:27 -0400 Subject: [PATCH 19/30] add subdir name --- .github/workflows/test-simple-with-ss3-artifacts.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index ce04232d..e6571951 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -43,10 +43,6 @@ jobs: if: startsWith(matrix.os, 'macos-') run: brew install bash - # - name: Set SHELL to bash 5 on macOS - # if: startsWith(matrix.os, 'macos-') - # run: echo "/opt/homebrew/bin/bash" >> $GITHUB_PATH - - name: Find latest successful build-ss3 workflow run in nmfs-ost/ss3-source-code id: get_run uses: actions/github-script@v7 @@ -147,8 +143,9 @@ jobs: - name: Copy SS3 executable to Simple model directory shell: bash run: | + subdir="${{ matrix.artifact_name}}" exe="${{ matrix.exe_name }}" - src="ss3_artifacts/$exe" + src="ss3_artifacts/$subdir/$exe" dest="ss3-test-models/models/Simple/$exe" cp "$src" "$dest" chmod +x "$dest" || true @@ -158,9 +155,9 @@ jobs: run: | cd ss3-test-models/models/Simple if [ "${{ runner.os }}" = "Windows" ]; then - .\${{ matrix.exe_name }} + .\${{ matrix.exe_name }} - nohess -stopph 0 else - ./${{ matrix.exe_name }} + ./${{ matrix.exe_name }} -nohess -stopph 0 fi - name: Archive Simple model output From 631b07d41e116765d404c7d5a0014208b13c79a6 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 14:26:54 -0400 Subject: [PATCH 20/30] look at all files from ss3_artifacts --- .github/workflows/test-simple-with-ss3-artifacts.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index e6571951..bd8b1805 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -140,6 +140,12 @@ jobs: shell: bash run: mkdir -p ss3-test-models/models/Simple + - name: see what files exist + shell: bash + run: | + echo "Files in ss3_artifacts:" + find ss3_artifacts + - name: Copy SS3 executable to Simple model directory shell: bash run: | From 93cae22693f070c8a0b02e5d62228c48935f5c4b Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 15:26:17 -0400 Subject: [PATCH 21/30] add back step to unzip files --- .github/workflows/test-simple-with-ss3-artifacts.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index bd8b1805..97ee3e90 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -130,6 +130,16 @@ jobs: -H "Authorization: Bearer $GH_TOKEN" \ "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + - name: Unzip SS3 executable + shell: bash + run: | + cd ss3_artifacts + if [ "${{ runner.os }}" = "Windows" ]; then + powershell -Command "Expand-Archive -Path '${{ matrix.artifact_name }}.zip' -DestinationPath ." + else + unzip -o "${{ matrix.artifact_name }}.zip" + fi + - name: Checkout test models repository uses: actions/checkout@v4 with: From dc63fd2435278fbee32e3ee732d101af7e27fd2b Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 15:32:02 -0400 Subject: [PATCH 22/30] remove subdir --- .github/workflows/test-simple-with-ss3-artifacts.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 97ee3e90..4bd9c158 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -139,7 +139,7 @@ jobs: else unzip -o "${{ matrix.artifact_name }}.zip" fi - + - name: Checkout test models repository uses: actions/checkout@v4 with: @@ -159,9 +159,8 @@ jobs: - name: Copy SS3 executable to Simple model directory shell: bash run: | - subdir="${{ matrix.artifact_name}}" exe="${{ matrix.exe_name }}" - src="ss3_artifacts/$subdir/$exe" + src="ss3_artifacts/$exe" dest="ss3-test-models/models/Simple/$exe" cp "$src" "$dest" chmod +x "$dest" || true From 1b5508657d4e4f8944537705d6b00952413edbaf Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 15:51:58 -0400 Subject: [PATCH 23/30] add debugging lines --- .github/workflows/test-simple-with-ss3-artifacts.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 4bd9c158..2df92670 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -92,6 +92,13 @@ jobs: echo "RAW ARTIFACTS OUTPUT:" echo "$ARTIFACTS_JSON" + + echo "RAW ARTIFACTS OUTPUT:" + echo "$ARTIFACTS_JSON" | cat -v + echo "jq output is:" + echo "$ARTIFACTS_JSON" | jq -cr '.[] | select(. != null) | @base64' | cat -v + + if [ -z "$ARTIFACTS_JSON" ]; then echo "No artifacts JSON found -- previous step may have failed." exit 1 From 9a8fa422f421531d56b7ff8b36d85be4a9366666 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 16:00:18 -0400 Subject: [PATCH 24/30] add portion to remove extra carriage returns --- .../workflows/test-simple-with-ss3-artifacts.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 2df92670..6e0047bf 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -89,22 +89,11 @@ jobs: mkdir -p ss3_artifacts os_artifact="${{ matrix.artifact_name }}" ARTIFACTS_JSON='${{ steps.list_artifacts.outputs.artifacts }}' - echo "RAW ARTIFACTS OUTPUT:" - echo "$ARTIFACTS_JSON" - - + ARTIFACTS_JSON=$(echo "$ARTIFACTS_JSON" | tr -d '\r') echo "RAW ARTIFACTS OUTPUT:" echo "$ARTIFACTS_JSON" | cat -v - echo "jq output is:" - echo "$ARTIFACTS_JSON" | jq -cr '.[] | select(. != null) | @base64' | cat -v - - - if [ -z "$ARTIFACTS_JSON" ]; then - echo "No artifacts JSON found -- previous step may have failed." - exit 1 - fi - IFS=$'\n' artifacts=($(echo "$ARTIFACTS_JSON" | jq -r '.[] | @base64')) + IFS=$'\n' artifacts=($(echo "$ARTIFACTS_JSON" | jq -cr '.[] | select(. != null) | @base64' | tr -d '\r' | grep -v '^$')) if [[ ${#artifacts[@]} -eq 0 ]]; then echo "No artifacts found." exit 1 From 07de98149d4659ff197ab116be249016dfc1366a Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 16:10:01 -0400 Subject: [PATCH 25/30] fix api call --- .github/workflows/test-simple-with-ss3-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 6e0047bf..1c16a31b 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -124,7 +124,7 @@ jobs: gh api \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $GH_TOKEN" \ - "/repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" + "./repos/nmfs-ost/ss3-source-code/actions/artifacts/$found_id/zip" > "ss3_artifacts/$os_artifact.zip" - name: Unzip SS3 executable shell: bash From 2511cce38c2a20b795fe5c109aba4c0919ab54f2 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 16:14:07 -0400 Subject: [PATCH 26/30] fix run command --- .github/workflows/test-simple-with-ss3-artifacts.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 1c16a31b..391d8026 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -165,11 +165,7 @@ jobs: shell: bash run: | cd ss3-test-models/models/Simple - if [ "${{ runner.os }}" = "Windows" ]; then - .\${{ matrix.exe_name }} - nohess -stopph 0 - else - ./${{ matrix.exe_name }} -nohess -stopph 0 - fi + ./${{ matrix.exe_name }} -nohess -stopph 0 - name: Archive Simple model output uses: actions/upload-artifact@v4 From 6c455dcbd81f5d758d807182ed99c0f704f5864c Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 16:22:43 -0400 Subject: [PATCH 27/30] add fail if control new file isn't found --- .github/workflows/test-simple-with-ss3-artifacts.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 391d8026..0be92aa8 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -167,6 +167,14 @@ jobs: cd ss3-test-models/models/Simple ./${{ matrix.exe_name }} -nohess -stopph 0 + - name: Check if model ran successfully + shell: bash + run: | + if [ ! -f "ss3-test-models/models/Simple/control.ss_new" ]; then + echo "ERROR: control.ss_new not found in ss3-test-models/models/Simple + exit 1 + fi + - name: Archive Simple model output uses: actions/upload-artifact@v4 with: From 5629962acea36c0de64ebd97dc8a5e94fe31e505 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 7 Jul 2025 16:28:07 -0400 Subject: [PATCH 28/30] fix --- .github/workflows/test-simple-with-ss3-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 0be92aa8..4e99336d 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -171,7 +171,7 @@ jobs: shell: bash run: | if [ ! -f "ss3-test-models/models/Simple/control.ss_new" ]; then - echo "ERROR: control.ss_new not found in ss3-test-models/models/Simple + echo "ERROR: control.ss_new not found!" exit 1 fi From 73a6ce72fcfc19c2caf2f413bd1120d1e44d3bf6 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Mon, 14 Jul 2025 14:24:41 +0000 Subject: [PATCH 29/30] only have test simple with artifacts run with success of build; add cancel concurrent actions --- .github/workflows/build-ss3-warnings.yml | 4 ++++ .github/workflows/build-ss3.yml | 5 ++++- .github/workflows/run-ss3-bootstrap.yml | 4 ++++ .github/workflows/run-ss3-mcmc.yml | 6 +++++- .github/workflows/run-ss3-no-est.yml | 4 ++++ .github/workflows/run-ss3-with-est.yml | 4 ++++ .github/workflows/test-r4ss-with-ss3.yml | 4 ++++ .../workflows/test-simple-with-ss3-artifacts.yml | 13 +++++++++---- 8 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-ss3-warnings.yml b/.github/workflows/build-ss3-warnings.yml index 7bd21116..945ef67c 100644 --- a/.github/workflows/build-ss3-warnings.yml +++ b/.github/workflows/build-ss3-warnings.yml @@ -19,6 +19,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + jobs: build-warnings: if: github.event.pull_request.draft == false diff --git a/.github/workflows/build-ss3.yml b/.github/workflows/build-ss3.yml index 7418bae5..655a9a46 100644 --- a/.github/workflows/build-ss3.yml +++ b/.github/workflows/build-ss3.yml @@ -10,7 +10,10 @@ on: - '**.sh' workflow_dispatch: - +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + jobs: build-ss3: runs-on: ${{ matrix.config.os }} diff --git a/.github/workflows/run-ss3-bootstrap.yml b/.github/workflows/run-ss3-bootstrap.yml index af3fd92d..aa1e8910 100644 --- a/.github/workflows/run-ss3-bootstrap.yml +++ b/.github/workflows/run-ss3-bootstrap.yml @@ -17,6 +17,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + jobs: run-ss3-bootstrap-files: if: github.event.pull_request.draft == false diff --git a/.github/workflows/run-ss3-mcmc.yml b/.github/workflows/run-ss3-mcmc.yml index 29b29df5..8ec627bf 100644 --- a/.github/workflows/run-ss3-mcmc.yml +++ b/.github/workflows/run-ss3-mcmc.yml @@ -15,7 +15,11 @@ on: - '**.tpl' branches: - main - + +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + # Check MCMC works jobs: run-ss3-no-est: diff --git a/.github/workflows/run-ss3-no-est.yml b/.github/workflows/run-ss3-no-est.yml index ccd0e537..b8d18e54 100644 --- a/.github/workflows/run-ss3-no-est.yml +++ b/.github/workflows/run-ss3-no-est.yml @@ -14,6 +14,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + # Run models without estimation, then try to run again with .ss_new jobs: run-ss3-no-est: diff --git a/.github/workflows/run-ss3-with-est.yml b/.github/workflows/run-ss3-with-est.yml index 2225df50..f3611431 100644 --- a/.github/workflows/run-ss3-with-est.yml +++ b/.github/workflows/run-ss3-with-est.yml @@ -17,6 +17,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + # Run fast running SS3 test models with estimation jobs: run-ss3-with-est: diff --git a/.github/workflows/test-r4ss-with-ss3.yml b/.github/workflows/test-r4ss-with-ss3.yml index e1d9e618..e24f4475 100644 --- a/.github/workflows/test-r4ss-with-ss3.yml +++ b/.github/workflows/test-r4ss-with-ss3.yml @@ -16,6 +16,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + # Run models without estimation, then run r4ss SS_plots() and SS_output() jobs: test-r4ss-with-ss3: diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 4e99336d..5fadf56f 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -1,12 +1,17 @@ on: - push: - # paths: - # - '**.tpl' - # - '**.sh' + workflow_run: + workflows: ["build-ss3"] + types: + - completed workflow_dispatch: +concurrency: + group: ${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + jobs: test-simple-model: + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ${{ matrix.os }} strategy: matrix: From 96e3c8282fc44038b3363b6da6bbfc3abbef0261 Mon Sep 17 00:00:00 2001 From: Elizabeth Perl Date: Tue, 15 Jul 2025 15:02:11 -0400 Subject: [PATCH 30/30] Potential fix for code scanning alert no. 26: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/test-simple-with-ss3-artifacts.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 5fadf56f..4399d23f 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -5,6 +5,10 @@ on: - completed workflow_dispatch: +permissions: + contents: read + actions: read + concurrency: group: ${{ github.workflow}}-${{ github.ref }} cancel-in-progress: true