From 10ce307331a31e55d06b38e317d410e6317bf5cc Mon Sep 17 00:00:00 2001 From: Richard Melkonian Date: Tue, 27 Feb 2024 00:03:50 +0000 Subject: [PATCH 1/4] add submodules commands --- .github/workflows/rust.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..0fe8da238 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,29 @@ +name: Rust + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + # This option ensures that Git submodules are recursively checked out + submodules: 'recursive' + + # New step to explicitly ensure submodules are up to date + - name: Initialize and update git submodules + run: | + git submodule sync --recursive + git submodule update --init --recursive + + - name: Build + run: cargo build --verbose From b39ad80114455fe783073856f44c2cfbf6341635 Mon Sep 17 00:00:00 2001 From: Richard Melkonian Date: Tue, 27 Feb 2024 09:08:32 +0000 Subject: [PATCH 2/4] fetch-depth 0 --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0fe8da238..65bb2125c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,6 +18,7 @@ jobs: with: # This option ensures that Git submodules are recursively checked out submodules: 'recursive' + fetch-depth: 0 # New step to explicitly ensure submodules are up to date - name: Initialize and update git submodules From 011224d4e86691e9c5f0c1f9d01df4cbe6f450c2 Mon Sep 17 00:00:00 2001 From: Richard Melkonian Date: Tue, 27 Feb 2024 09:23:11 +0000 Subject: [PATCH 3/4] configure submodule URLs --- .github/workflows/rust.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 65bb2125c..8f0af8ac5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,8 +19,20 @@ jobs: # This option ensures that Git submodules are recursively checked out submodules: 'recursive' fetch-depth: 0 - - # New step to explicitly ensure submodules are up to date + + # Configure submodule URLs as specified in .gitmodules + - name: Configure submodule URLs + run: | + while IFS= read -r line; do + if [[ "$line" =~ \[submodule\..*\] ]]; then + module_path=$(echo "$line" | sed -e 's/\[submodule\."//' -e 's/"\]//') + module_url=$(git config --file .gitmodules --get submodule."$module_path".url) + git config --file .gitmodules submodule."$module_path".url "$module_url" + fi + done < .gitmodules + git submodule sync --recursive + + # Initialize and update git submodules - name: Initialize and update git submodules run: | git submodule sync --recursive From 5624bf6bb687cccde14309c2791865891873e5c2 Mon Sep 17 00:00:00 2001 From: Richard Melkonian Date: Tue, 27 Feb 2024 09:26:04 +0000 Subject: [PATCH 4/4] skip auto handle of submodules --- .github/workflows/rust.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8f0af8ac5..32fa3b2e5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,27 +16,18 @@ jobs: steps: - uses: actions/checkout@v3 with: - # This option ensures that Git submodules are recursively checked out - submodules: 'recursive' + # Fetches the main repo but skips automatic handling of submodules + submodules: false fetch-depth: 0 - # Configure submodule URLs as specified in .gitmodules - - name: Configure submodule URLs + # Manually handle submodules + - name: Handle Git Submodules run: | - while IFS= read -r line; do - if [[ "$line" =~ \[submodule\..*\] ]]; then - module_path=$(echo "$line" | sed -e 's/\[submodule\."//' -e 's/"\]//') - module_url=$(git config --file .gitmodules --get submodule."$module_path".url) - git config --file .gitmodules submodule."$module_path".url "$module_url" - fi - done < .gitmodules - git submodule sync --recursive - - # Initialize and update git submodules - - name: Initialize and update git submodules - run: | - git submodule sync --recursive + # Initialize submodules git submodule update --init --recursive + # Sync submodules in case .gitmodules has been updated + git submodule sync --recursive + # Attempt to fix any specific submodule fetching issues here, if applicable - name: Build run: cargo build --verbose