From b0342b0dfa36fff83c575d2d208f4eddc7e06225 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Mon, 31 Mar 2025 09:56:40 -0400 Subject: [PATCH] ci: check subtrees Does a checkout of the full commit history and checks the status integrity of each subtree using the git-subtree-check.sh provided in contrib/devtools. Default subtree remotes are defined in the new file contrib/subtrees.json --- .github/workflows/linter.yml | 15 +++++++++++++++ contrib/subtrees.json | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 contrib/subtrees.json diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 81ae2520b..85f16cfd8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -15,3 +15,18 @@ jobs: - uses: actions/checkout@v4 - name: Lint translation files run: python3 contrib/devtools/check-translations.py + subtrees: + name: Check Subtrees + runs-on: ubuntu-24.04 + steps: + - name: Install prerequisites + run: sudo apt update && sudo apt install -y bash git jq + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check subtree integrity + run: | + jq -r '.[] | [.name, .remote] | join(" ")' contrib/subtrees.json | xargs -n2 git remote add + jq -r '.[].name' contrib/subtrees.json | xargs -n1 git fetch + jq -r '.[].path' contrib/subtrees.json | xargs -n1 bash contrib/devtools/git-subtree-check.sh diff --git a/contrib/subtrees.json b/contrib/subtrees.json new file mode 100644 index 000000000..1c614f80a --- /dev/null +++ b/contrib/subtrees.json @@ -0,0 +1,17 @@ +[ + { + "name": "univalue-subtree", + "path": "src/univalue", + "remote": "https://github.com/dogecoin/univalue-subtree.git" + }, + { + "name": "secp256k1-subtree", + "path": "src/secp256k1", + "remote": "https://github.com/bitcoin-core/secp256k1.git" + }, + { + "name": "leveldb-subtree", + "path": "src/leveldb", + "remote": "https://github.com/bitcoin-core/leveldb-subtree" + } +]