Skip to content

Commit 5af7ba1

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 08b0485 commit 5af7ba1

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
@@ -566,17 +566,30 @@ jobs:
566566
if: ${{ github.event_name != 'pull_request_target' }}
567567
uses: actions/checkout@v4
568568
with:
569-
submodules: recursive
570569
persist-credentials: false
571570

572571
- name: Check out source code (pull request)
573572
if: ${{ github.event_name == 'pull_request_target' }}
574573
uses: actions/checkout@v4
575574
with:
576575
ref: ${{ github.event.pull_request.head.sha }}
577-
submodules: recursive
578576
persist-credentials: false
579577

578+
- name: Check out submodules
579+
run: |
580+
git config --global --add safe.directory '*'
581+
git submodule init
582+
git submodule update --depth=1 --recursive crosskit/crosskit-x86_64-apple-darwin
583+
git submodule update --depth=1 --recursive crosskit/crosskit-x86_64-darwin-libpython
584+
git submodule update --depth=1 --recursive crosskit/crosskit-mingw-w64-libpython
585+
git submodule update --depth=1 --recursive crosstool-ng
586+
git submodule update --depth=1 --recursive binutils
587+
git submodule update --depth=1 --recursive binutils_arc
588+
git submodule update --depth=1 --recursive gdb
589+
git submodule update --depth=1 --recursive gcc
590+
git submodule update --depth=1 --recursive gcc_arc
591+
git submodule update --depth=1 --recursive picolibc
592+
580593
- name: Build crosstool-ng
581594
run: |
582595
# Configure macOS build environment
@@ -884,17 +897,22 @@ jobs:
884897
if: ${{ github.event_name != 'pull_request_target' }}
885898
uses: actions/checkout@v4
886899
with:
887-
submodules: recursive
888900
persist-credentials: false
889901

890902
- name: Check out source code (pull request)
891903
if: ${{ github.event_name == 'pull_request_target' }}
892904
uses: actions/checkout@v4
893905
with:
894906
ref: ${{ github.event.pull_request.head.sha }}
895-
submodules: recursive
896907
persist-credentials: false
897908

909+
- name: Check out submodules
910+
run: |
911+
git config --global --add safe.directory '*'
912+
git submodule init
913+
git submodule update --depth=1 --recursive llvm
914+
git submodule update --depth=1 --recursive picolibc
915+
898916
- name: Setup debug session (pre)
899917
if: always() && needs.setup.outputs.debug == 'toolchain-pre'
900918
uses: mxschmitt/action-tmate@v3
@@ -1020,17 +1038,23 @@ jobs:
10201038
if: ${{ github.event_name != 'pull_request_target' }}
10211039
uses: actions/checkout@v4
10221040
with:
1023-
submodules: recursive
10241041
persist-credentials: false
10251042

10261043
- name: Check out source code (pull request)
10271044
if: ${{ github.event_name == 'pull_request_target' }}
10281045
uses: actions/checkout@v4
10291046
with:
10301047
ref: ${{ github.event.pull_request.head.sha }}
1031-
submodules: recursive
10321048
persist-credentials: false
10331049

1050+
- name: Check out submodules
1051+
run: |
1052+
git config --global --add safe.directory '*'
1053+
git submodule init
1054+
git submodule update --depth=1 --recursive qemu
1055+
git submodule update --depth=1 --recursive qemu_arc
1056+
git submodule update --depth=1 --recursive qemu_xilinx
1057+
10341058
- name: Configure AWS Credentials
10351059
uses: aws-actions/configure-aws-credentials@v4
10361060
with:

0 commit comments

Comments
 (0)