Skip to content

Commit f026226

Browse files
committed
ci: Selectively check out submodules
Check out only the needed submodules in each job to reduce unnecessary network load and job preparation time. This is especially important now since large host tool components, such as QEMU, are added as submodules. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 4690325 commit f026226

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,17 +563,30 @@ jobs:
563563
if: ${{ github.event_name != 'pull_request_target' }}
564564
uses: actions/checkout@v4
565565
with:
566-
submodules: recursive
567566
persist-credentials: false
568567

569568
- name: Check out source code (pull request)
570569
if: ${{ github.event_name == 'pull_request_target' }}
571570
uses: actions/checkout@v4
572571
with:
573572
ref: ${{ github.event.pull_request.head.sha }}
574-
submodules: recursive
575573
persist-credentials: false
576574

575+
- name: Check out submodules
576+
run: |
577+
git config --global --add safe.directory '*'
578+
git submodule init
579+
git submodule update --depth=1 --recursive crosskit/crosskit-x86_64-apple-darwin
580+
git submodule update --depth=1 --recursive crosskit/crosskit-x86_64-darwin-libpython
581+
git submodule update --depth=1 --recursive crosskit/crosskit-mingw-w64-libpython
582+
git submodule update --depth=1 --recursive crosstool-ng
583+
git submodule update --depth=1 --recursive binutils
584+
git submodule update --depth=1 --recursive binutils_arc
585+
git submodule update --depth=1 --recursive gdb
586+
git submodule update --depth=1 --recursive gcc
587+
git submodule update --depth=1 --recursive gcc_arc
588+
git submodule update --depth=1 --recursive picolibc
589+
577590
- name: Build crosstool-ng
578591
run: |
579592
# Configure macOS build environment
@@ -881,17 +894,22 @@ jobs:
881894
if: ${{ github.event_name != 'pull_request_target' }}
882895
uses: actions/checkout@v4
883896
with:
884-
submodules: recursive
885897
persist-credentials: false
886898

887899
- name: Check out source code (pull request)
888900
if: ${{ github.event_name == 'pull_request_target' }}
889901
uses: actions/checkout@v4
890902
with:
891903
ref: ${{ github.event.pull_request.head.sha }}
892-
submodules: recursive
893904
persist-credentials: false
894905

906+
- name: Check out submodules
907+
run: |
908+
git config --global --add safe.directory '*'
909+
git submodule init
910+
git submodule update --depth=1 --recursive llvm
911+
git submodule update --depth=1 --recursive picolibc
912+
895913
- name: Setup debug session (pre)
896914
if: always() && needs.setup.outputs.debug == 'toolchain-pre'
897915
uses: mxschmitt/action-tmate@v3
@@ -1017,17 +1035,23 @@ jobs:
10171035
if: ${{ github.event_name != 'pull_request_target' }}
10181036
uses: actions/checkout@v4
10191037
with:
1020-
submodules: recursive
10211038
persist-credentials: false
10221039

10231040
- name: Check out source code (pull request)
10241041
if: ${{ github.event_name == 'pull_request_target' }}
10251042
uses: actions/checkout@v4
10261043
with:
10271044
ref: ${{ github.event.pull_request.head.sha }}
1028-
submodules: recursive
10291045
persist-credentials: false
10301046

1047+
- name: Check out submodules
1048+
run: |
1049+
git config --global --add safe.directory '*'
1050+
git submodule init
1051+
git submodule update --depth=1 --recursive qemu
1052+
git submodule update --depth=1 --recursive qemu_arc
1053+
git submodule update --depth=1 --recursive qemu_xilinx
1054+
10311055
- name: Configure AWS Credentials
10321056
uses: aws-actions/configure-aws-credentials@v4
10331057
with:

0 commit comments

Comments
 (0)