From 9e89eec5294f79f45898ec94c45e027dce514d03 Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Mon, 18 Aug 2025 15:44:07 -0400 Subject: [PATCH 1/8] try fix spacing and add name --- .github/workflows/build-ss3.yml | 6 +++--- .github/workflows/run-ss3-with-est.yml | 2 +- .github/workflows/test-simple-with-ss3-artifacts.yml | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ss3.yml b/.github/workflows/build-ss3.yml index b1f94fa9..3e894f69 100644 --- a/.github/workflows/build-ss3.yml +++ b/.github/workflows/build-ss3.yml @@ -5,9 +5,9 @@ name: build-ss3 on: push: - paths: - - '**.tpl' - - '**.sh' + # paths: + # - '**.tpl' + # - '**.sh' workflow_dispatch: concurrency: diff --git a/.github/workflows/run-ss3-with-est.yml b/.github/workflows/run-ss3-with-est.yml index aeae3567..e4b3e361 100644 --- a/.github/workflows/run-ss3-with-est.yml +++ b/.github/workflows/run-ss3-with-est.yml @@ -25,7 +25,7 @@ concurrency: jobs: run-ss3-with-est: # if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.draft == 'false'}} - runs-on: ubuntu-latest + runs-on: macos-latest env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index ef6b05f9..b4b5a231 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -1,3 +1,4 @@ +name: test-simple-with-ss3-artifacts on: workflow_run: workflows: ["build-ss3"] @@ -10,7 +11,7 @@ permissions: actions: read concurrency: - group: ${{ github.workflow}}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: From ad435762f83c765a950dc181a73311c80eaaa7ab Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Mon, 18 Aug 2025 16:43:59 -0400 Subject: [PATCH 2/8] try download artifact premade action --- .../test-simple-with-ss3-artifacts.yml | 97 ++++++++++--------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index b4b5a231..c1c1e759 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -90,51 +90,58 @@ jobs: core.setOutput("artifacts", JSON.stringify(artifacts.artifacts)); - name: Download artifact for this OS - id: download_artifact - shell: bash - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -e - mkdir -p ss3_artifacts - os_artifact="${{ matrix.artifact_name }}" - ARTIFACTS_JSON='${{ steps.list_artifacts.outputs.artifacts }}' - ARTIFACTS_JSON=$(echo "$ARTIFACTS_JSON" | tr -d '\r') - echo "RAW ARTIFACTS OUTPUT:" - echo "$ARTIFACTS_JSON" | cat -v - - 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 - 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" + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.artifact_name }} + run-id: ${{ steps.get_run.outputs.run_id }} + path: ss3_artifacts + + # - name: Download artifact for this OS + # id: download_artifact + # shell: bash + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # set -e + # mkdir -p ss3_artifacts + # os_artifact="${{ matrix.artifact_name }}" + # ARTIFACTS_JSON='${{ steps.list_artifacts.outputs.artifacts }}' + # ARTIFACTS_JSON=$(echo "$ARTIFACTS_JSON" | tr -d '\r') + # echo "RAW ARTIFACTS OUTPUT:" + # echo "$ARTIFACTS_JSON" | cat -v + + # 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 + # 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: Unzip SS3 executable shell: bash From e8cfbca12074f507ddbd44ee145be6877e098234 Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Mon, 18 Aug 2025 17:17:58 -0400 Subject: [PATCH 3/8] try this to get run_id --- .../test-simple-with-ss3-artifacts.yml | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index c1c1e759..ab0b0bc3 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -53,27 +53,35 @@ jobs: if: startsWith(matrix.os, 'macos-') run: brew install bash - - name: Find latest successful build-ss3 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: + # 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 === "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", + # workflow_id: workflow.id, + # status: "success", + # per_page: 1 + # }); + # if (!runs.workflow_runs.length) throw "No successful runs found for 'build-ss3'."; + # core.setOutput("run_id", runs.workflow_runs[0].id); + + - name: Get latest ss3-build workflow run ID 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 === "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", - workflow_id: workflow.id, - status: "success", - per_page: 1 - }); - if (!runs.workflow_runs.length) throw "No successful runs found for 'build-ss3'."; - core.setOutput("run_id", runs.workflow_runs[0].id); + run: | + RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ss3-build.yml/runs --jq '.workflow_runs[0].id') + echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: List artifacts from build-ss3 run id: list_artifacts From ea06f3dcd92e003f4459d347d0ed5decb54c9fec Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Tue, 19 Aug 2025 10:04:07 -0400 Subject: [PATCH 4/8] try using workflow run id --- .../test-simple-with-ss3-artifacts.yml | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index ab0b0bc3..08b0b01a 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -75,33 +75,33 @@ jobs: # if (!runs.workflow_runs.length) throw "No successful runs found for 'build-ss3'."; # core.setOutput("run_id", runs.workflow_runs[0].id); - - name: Get latest ss3-build workflow run ID - id: get_run - run: | - RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ss3-build.yml/runs --jq '.workflow_runs[0].id') - echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: List artifacts from build-ss3 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: Get latest ss3-build workflow run ID + # id: get_run + # run: | + # RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ss3-build.yml/runs --jq '.workflow_runs[0].id') + # echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - name: List artifacts from build-ss3 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 uses: actions/download-artifact@v4 with: name: ${{ matrix.artifact_name }} - run-id: ${{ steps.get_run.outputs.run_id }} + run-id: ${{ github.event.workflow_run.id }} path: ss3_artifacts # - name: Download artifact for this OS From b4c0a6cabacb55922dacbe2c4b39ce522cf19c6a Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Tue, 19 Aug 2025 10:54:48 -0400 Subject: [PATCH 5/8] simplify --- .../test-simple-with-ss3-artifacts.yml | 91 ------------------- 1 file changed, 91 deletions(-) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 08b0b01a..648a5514 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -53,50 +53,6 @@ jobs: if: startsWith(matrix.os, 'macos-') run: brew install bash - # - name: Find latest successful build-ss3 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 === "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", - # workflow_id: workflow.id, - # status: "success", - # per_page: 1 - # }); - # if (!runs.workflow_runs.length) throw "No successful runs found for 'build-ss3'."; - # core.setOutput("run_id", runs.workflow_runs[0].id); - - # - name: Get latest ss3-build workflow run ID - # id: get_run - # run: | - # RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ss3-build.yml/runs --jq '.workflow_runs[0].id') - # echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: List artifacts from build-ss3 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 uses: actions/download-artifact@v4 with: @@ -104,53 +60,6 @@ jobs: run-id: ${{ github.event.workflow_run.id }} path: ss3_artifacts - # - name: Download artifact for this OS - # id: download_artifact - # shell: bash - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # set -e - # mkdir -p ss3_artifacts - # os_artifact="${{ matrix.artifact_name }}" - # ARTIFACTS_JSON='${{ steps.list_artifacts.outputs.artifacts }}' - # ARTIFACTS_JSON=$(echo "$ARTIFACTS_JSON" | tr -d '\r') - # echo "RAW ARTIFACTS OUTPUT:" - # echo "$ARTIFACTS_JSON" | cat -v - - # 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 - # 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: Unzip SS3 executable shell: bash run: | From b37d446ddd19b0802a3a9da37d152127cfee3635 Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Tue, 19 Aug 2025 11:34:07 -0400 Subject: [PATCH 6/8] try homebrew with fix for build admb and ss3 --- .github/workflows/build-admb-and-ss3-from-source.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-admb-and-ss3-from-source.yml b/.github/workflows/build-admb-and-ss3-from-source.yml index 44ad9ce6..9eef1d13 100644 --- a/.github/workflows/build-admb-and-ss3-from-source.yml +++ b/.github/workflows/build-admb-and-ss3-from-source.yml @@ -27,6 +27,14 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v5 + + - name: Update Homebrew + if: matrix.config.os == 'macos-13' + run: brew update + + - name: Install qpdf + if: matrix.config.os == 'macos-13' + run: brew install qpdf # Set up R - name: Set up R, specify rtools version and path for Windows From 604db98ed69e049ecf1f3858f14954fba3d79182 Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Tue, 19 Aug 2025 12:00:45 -0400 Subject: [PATCH 7/8] try specifying repository too --- .../workflows/test-simple-with-ss3-artifacts.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test-simple-with-ss3-artifacts.yml b/.github/workflows/test-simple-with-ss3-artifacts.yml index 648a5514..e63e20b7 100644 --- a/.github/workflows/test-simple-with-ss3-artifacts.yml +++ b/.github/workflows/test-simple-with-ss3-artifacts.yml @@ -52,12 +52,26 @@ jobs: - name: Use Bash 5 on macOS if: startsWith(matrix.os, 'macos-') run: brew install bash + + - name: List all artifacts for workflow run + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const run_id = ${{ github.event.workflow_run.id }}; + const { data: artifacts } = await github.rest.actions.listWorkflowRunArtifacts({ + owner: "nmfs-ost", + repo: "ss3-source-code", + run_id + }); + console.log(artifacts.artifacts); - name: Download artifact for this OS uses: actions/download-artifact@v4 with: name: ${{ matrix.artifact_name }} run-id: ${{ github.event.workflow_run.id }} + repository: nmfs-ost/ss3-source-code path: ss3_artifacts - name: Unzip SS3 executable From f39a5c7ea43ccea357562f8d439b0cbaa20f263a Mon Sep 17 00:00:00 2001 From: e-perl-NOAA Date: Tue, 19 Aug 2025 12:30:50 -0400 Subject: [PATCH 8/8] put back path specifications for build --- .github/workflows/build-ss3.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ss3.yml b/.github/workflows/build-ss3.yml index 3e894f69..b1f94fa9 100644 --- a/.github/workflows/build-ss3.yml +++ b/.github/workflows/build-ss3.yml @@ -5,9 +5,9 @@ name: build-ss3 on: push: - # paths: - # - '**.tpl' - # - '**.sh' + paths: + - '**.tpl' + - '**.sh' workflow_dispatch: concurrency: