Skip to content

Commit

Permalink
[ci] Checkout only relevant submodules (#17250)
Browse files Browse the repository at this point in the history
* [ci] Checkout only relevant submodules

1. Associate submodules to platforms for which they're
   needed.
2. Add a script that is able to checkout submodules for
   specific platforms only.
3. Use the script in CI workflows.

* Fix cirque build

* Address code reviews
  • Loading branch information
Damian-Nordic authored and pull[bot] committed Aug 10, 2023
1 parent 5af5edf commit 2052191
Show file tree
Hide file tree
Showing 25 changed files with 207 additions and 32 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -126,7 +127,6 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
Expand All @@ -135,6 +135,8 @@ jobs:
# uses: github/codeql-action/init@v1
# with:
# languages: "cpp"
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -255,10 +257,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -286,7 +289,6 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
Expand All @@ -295,6 +297,8 @@ jobs:
# uses: github/codeql-action/init@v1
# with:
# languages: "cpp"
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform darwin
- name: Setup Environment
run: brew install openssl pkg-config
- name: Try to ensure the directory for diagnostic log collection exists
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux

- name: Get cirque cache key
id: cirque-key
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform darwin
- name: Setup Environment
run: brew install openssl pkg-config python@3.9
- name: Fix pkgconfig link
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-ameba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform ameba
- name: Build example Ameba All Clusters App
run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'ameba-*' build"
3 changes: 2 additions & 1 deletion .github/workflows/examples-cc13x2x7_26x2x7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform cc13x2_26x2
- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-cyw30739.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform cyw30739

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform efr32

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform esp32

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down Expand Up @@ -127,10 +128,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform esp32

- name: Bootstrap
timeout-minutes: 10
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform p6

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-k32w.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform k32w0

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-linux-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-linux-imx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux

- name: Build App
timeout-minutes: 30
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-mbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform mbed

- name: Detect changed paths
uses: dorny/paths-filter@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform nrfconnect
- name: Detect changed paths
uses: dorny/paths-filter@v2
id: changed_paths
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-qpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform qpg

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform telink

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/examples-tizen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform tizen
- name: Build example Tizen lighting app
run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'tizen-*' build"
3 changes: 2 additions & 1 deletion .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform esp32
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform android
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Try to ensure the directories for core dumping exist and we
can write them.
run: |
Expand Down Expand Up @@ -136,10 +137,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform darwin
- name: Setup Environment
# coreutils for stdbuf
run: brew install openssl pkg-config coreutils
Expand Down Expand Up @@ -240,8 +242,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name:
Try to ensure the directories for core dumping exist and we
can write them.
Expand Down Expand Up @@ -311,8 +313,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform darwin
- name: Setup Environment
# coreutils for stdbuf
run: brew install openssl pkg-config coreutils
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Bootstrap
timeout-minutes: 10
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/zap_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ jobs:
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Setup ZAP
timeout-minutes: 10
run: |
Expand Down
Loading

0 comments on commit 2052191

Please sign in to comment.