From 64b38cbef36b73ae2a4780605033c8c9e6f91869 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Sat, 28 Jun 2025 16:34:48 -0600 Subject: [PATCH] Add workflows for linting and syncing subtrees.json --- src/phreeqcpp/.github/subtrees.json | 6 ++++ .../.github/workflows/lint-subtrees.yml | 22 +++++++++++++ src/phreeqcpp/.github/workflows/subtree.yml | 32 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 src/phreeqcpp/.github/subtrees.json create mode 100644 src/phreeqcpp/.github/workflows/lint-subtrees.yml create mode 100644 src/phreeqcpp/.github/workflows/subtree.yml diff --git a/src/phreeqcpp/.github/subtrees.json b/src/phreeqcpp/.github/subtrees.json new file mode 100644 index 00000000..7f076eb3 --- /dev/null +++ b/src/phreeqcpp/.github/subtrees.json @@ -0,0 +1,6 @@ +[ + { + "prefix": "common", + "url": "git@${CI_SERVER_HOST}:${GROUP}-subtrees/phreeqc3-src-common.git" + } +] \ No newline at end of file diff --git a/src/phreeqcpp/.github/workflows/lint-subtrees.yml b/src/phreeqcpp/.github/workflows/lint-subtrees.yml new file mode 100644 index 00000000..4306e374 --- /dev/null +++ b/src/phreeqcpp/.github/workflows/lint-subtrees.yml @@ -0,0 +1,22 @@ +# This workflow lints the subtrees.json file to ensure it is valid and up-to-date. +# It is triggered on pull requests that modify the subtrees.json file or can be run manually +# via the GitHub Actions UI. +name: Lint subtrees.json + +on: + pull_request: + paths: + - '.github/subtrees.json' + workflow_call: + workflow_dispatch: + +jobs: + lint-subtrees: + runs-on: ubuntu-latest + env: + CI_SERVER_HOST: github.com + GROUP: usgs-coupled + steps: + - uses: usgs-coupled/sync-subtrees-action/lint-subtrees/@main + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/src/phreeqcpp/.github/workflows/subtree.yml b/src/phreeqcpp/.github/workflows/subtree.yml new file mode 100644 index 00000000..1f62d41d --- /dev/null +++ b/src/phreeqcpp/.github/workflows/subtree.yml @@ -0,0 +1,32 @@ +name: Sync Subtrees + +on: + workflow_dispatch: + inputs: + dryRun: + description: 'If true, don’t push any changes (for testing only).' + required: true + default: true + type: boolean + testMerge: + description: 'Run in test mode, pushing to a test branch.' + required: true + default: false + type: boolean + +jobs: + sync-subtrees: + runs-on: ubuntu-latest + env: + CI_SERVER_HOST: github.com + GROUP: usgs-coupled + steps: + - name: Run sync-subtrees-action + uses: usgs-coupled/sync-subtrees-action@main + with: + dryRun: ${{ inputs.dryRun }} + testMerge: ${{ inputs.testMerge }} + repository_name: ${{ github.event.repository.name }} + default_branch: ${{ github.event.repository.default_branch }} + run_number: ${{ github.run_number }} + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}