From ceead83c641c84f224fea00a057687c9b8e3645c Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Fri, 25 Sep 2020 23:47:28 +0000 Subject: [PATCH 1/6] Update submodules to not be auto cloned --- .github/workflows/ci.yml | 1 + .gitmodules | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f7da74dd..f3b6eda30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: steps: - name: Clone This Repo uses: actions/checkout@v2 + run: git submodule update --checkout - name: Build run: | sudo apt-get install -y lcov diff --git a/.gitmodules b/.gitmodules index e0ff33244..9d3f0f264 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,12 @@ [submodule "test/unit-test/CMock"] path = test/unit-test/CMock url = https://github.com/ThrowTheSwitch/CMock + update = none [submodule "test/cbmc/aws-templates-for-cbmc-proofs"] path = test/cbmc/aws-templates-for-cbmc-proofs url = https://github.com/awslabs/aws-templates-for-cbmc-proofs.git + update = none [submodule "test/cbmc/litani"] path = test/cbmc/litani url = https://github.com/awslabs/aws-build-accumulator + update = none From b54c87dd2a2ef383ef6dd094443b52eb3e278eb3 Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Sat, 26 Sep 2020 00:01:15 +0000 Subject: [PATCH 2/6] Update README about submoduling CMock --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 02576b9b0..d29782dfa 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,14 @@ For a CMake example of building the MQTT library with the `mqttFilePaths.cmake` ## Building Unit Tests +### Checkout CMock Submodule +By default, the submodules in this repository are configured with `update=none` in [.gitmodules](.gitmodules) to avoid increasing clone time and disk space usage of other repositories (like [amazon-freertos](https://github.com/aws/amazon-freertos) that submodule this repository. + +To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule: +``` +git submodule update --checkout --test/unit-test/CMock +``` + ### Platform Prerequisites - For running unit tests @@ -39,7 +47,7 @@ For a CMake example of building the MQTT library with the `mqttFilePaths.cmake` ### Steps to build **Unit Tests** -1. Go to the root directory of this repository. +1. Go to the root directory of this repository. (Make sure that the **CMock** submodule is cloned as described [above]()) 1. Run the *cmake* command: `cmake -S test -B build -DBUILD_CLONE_SUBMODULES=ON ` From 7f93c7e7df4f20758bd0f57290e988b5e8246204 Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Sat, 26 Sep 2020 00:09:22 +0000 Subject: [PATCH 3/6] Attempt to fix ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3b6eda30..e961dc471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Clone This Repo uses: actions/checkout@v2 - run: git submodule update --checkout + - run: git submodule update --checkout - name: Build run: | sudo apt-get install -y lcov From bee76f37249def04f7dd88239416d83f77aa91eb Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Sat, 26 Sep 2020 00:14:05 +0000 Subject: [PATCH 4/6] Fix submodule init issue --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e961dc471..6b2e55c5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,8 @@ jobs: steps: - name: Clone This Repo uses: actions/checkout@v2 - - run: git submodule update --checkout + - name: Checkout CMock submodule + run: git submodule update --init --checkout test/unit-test/CMock - name: Build run: | sudo apt-get install -y lcov From 06245547bda1ed81da51bb29961da3e0dbb4efdd Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Sat, 26 Sep 2020 00:17:25 +0000 Subject: [PATCH 5/6] Add --recursive flags to submodule clone command --- .github/workflows/ci.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b2e55c5c..305cb1913 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - name: Clone This Repo uses: actions/checkout@v2 - name: Checkout CMock submodule - run: git submodule update --init --checkout test/unit-test/CMock + run: git submodule update --checkout --init --recursive test/unit-test/CMock - name: Build run: | sudo apt-get install -y lcov diff --git a/README.md b/README.md index d29782dfa..f3d7dfcf2 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ By default, the submodules in this repository are configured with `update=none` To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule: ``` -git submodule update --checkout --test/unit-test/CMock +git submodule update --checkout --init --recursive --test/unit-test/CMock ``` ### Platform Prerequisites From 187a6a7a81f56d706714a0e4b69630bf2f3d67ed Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Sat, 26 Sep 2020 00:29:35 +0000 Subject: [PATCH 6/6] Add section link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3d7dfcf2..70da4c999 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ git submodule update --checkout --init --recursive --test/unit-test/CMock ### Steps to build **Unit Tests** -1. Go to the root directory of this repository. (Make sure that the **CMock** submodule is cloned as described [above]()) +1. Go to the root directory of this repository. (Make sure that the **CMock** submodule is cloned as described [above](#checkout-cmock-submodule)) 1. Run the *cmake* command: `cmake -S test -B build -DBUILD_CLONE_SUBMODULES=ON `