Skip to content

Commit

Permalink
Update submodule configuration for hub repo cloning efficiency (#75)
Browse files Browse the repository at this point in the history
* Update submodules to not be auto cloned

* Update README about submoduling CMock

* Attempt to fix ci.yml

* Fix submodule init issue

* Add --recursive flags to submodule clone command

* Add section link in README
  • Loading branch information
aggarw13 authored Sep 26, 2020
1 parent 494684f commit a127704
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Clone This Repo
uses: actions/checkout@v2
- name: Checkout CMock submodule
run: git submodule update --checkout --init --recursive test/unit-test/CMock
- name: Build
run: |
sudo apt-get install -y lcov
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 --init --recursive --test/unit-test/CMock
```

### Platform Prerequisites

- For running unit tests
Expand All @@ -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](#checkout-cmock-submodule))

1. Run the *cmake* command: `cmake -S test -B build -DBUILD_CLONE_SUBMODULES=ON `

Expand Down

0 comments on commit a127704

Please sign in to comment.