From cd10171329c35c7292b6fc3486645aa5f7bf6c7f Mon Sep 17 00:00:00 2001 From: Robert Brown Date: Tue, 7 Dec 2021 16:45:39 -0500 Subject: [PATCH 1/4] CI additions, and minor fixes --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++++ .github/workflows/utest.yml | 40 ++++++++++++++++++++++++ .github/workflows/validation.yml | 42 +++++++++++++++++++++++++ README.md | 8 ++++- fsw/crypto_util/app/et_dt_validation.c | 2 +- fsw/public_inc/crypto_structs.h | 2 +- 6 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/utest.yml create mode 100644 .github/workflows/validation.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..1207c496 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: Build + +on: + push: + branches: [ ut_tc_apply-enctests ] + #pull_request: + # branches: [ main ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: DEBUG + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev python3 + + - name: Install Python Libraries + run: sudo pip install pycryptodome + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + #- name: Test + #working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + #run: ctest -C ${{env.BUILD_TYPE}} + diff --git a/.github/workflows/utest.yml b/.github/workflows/utest.yml new file mode 100644 index 00000000..3caca04c --- /dev/null +++ b/.github/workflows/utest.yml @@ -0,0 +1,40 @@ +name: Unit Tests + +on: + push: + branches: [ ut_tc_apply-enctests ] + #pull_request: + # branches: [ main ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: DEBUG + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev python3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ${{github.workspace}}/build/bin/ut_tc_apply + diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml new file mode 100644 index 00000000..6fa7af27 --- /dev/null +++ b/.github/workflows/validation.yml @@ -0,0 +1,42 @@ +name: Validation Tests + +on: + push: + branches: [ ut_tc_apply-enctests ] + #pull_request: + # branches: [ main ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: DEBUG + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install Dependencies + run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev python3 + + - name: Install Python Libraries + run: sudo pip install pycryptodome + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENCTEST=1 + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ${{github.workspace}}/build/bin/et_dt_validation \ No newline at end of file diff --git a/README.md b/README.md index d57cbe92..601cf169 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ +![Build](https://github.com/nasa/CryptoLib/actions/workflows/build.yml/badge.svg) ![Unit Tests](https://github.com/nasa/CryptoLib/actions/workflows/utest.yml/badge.svg) ![Validation Tests](https://github.com/nasa/CryptoLib/actions/workflows/validation.yml/badge.svg) + # CryptoLib Provide a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station. In order to build crypto the following must be installed assuming Ubuntu 18.04 LTS: -* `sudo apt install libgpg-error-dev:i386 libgcrypt20-dev:i386` +* `sudo apt install libgpg-error-dev libgcrypt20-dev` + + +More information about building and usage of CryptoLib can be found within the repository Wiki: +https://github.com/nasa/CryptoLib/wiki diff --git a/fsw/crypto_util/app/et_dt_validation.c b/fsw/crypto_util/app/et_dt_validation.c index 94686030..c905e39e 100644 --- a/fsw/crypto_util/app/et_dt_validation.c +++ b/fsw/crypto_util/app/et_dt_validation.c @@ -894,7 +894,7 @@ UTEST(NIST_ENC_MAC_VALIDATION, AES_GCM_256_IV_96_PT_128_TEST_1) uint16 enc_data_idx = enc_frame_len - buffer_cyber_chef_mac_len - 2; for (int i=0; i Date: Tue, 7 Dec 2021 16:50:20 -0500 Subject: [PATCH 2/4] Modified CI to work on collab_main branch --- .github/workflows/build.yml | 2 +- .github/workflows/utest.yml | 2 +- .github/workflows/validation.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1207c496..f44d1d62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ ut_tc_apply-enctests ] + branches: [ collab_main ] #pull_request: # branches: [ main ] diff --git a/.github/workflows/utest.yml b/.github/workflows/utest.yml index 3caca04c..fd4f2a5a 100644 --- a/.github/workflows/utest.yml +++ b/.github/workflows/utest.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [ ut_tc_apply-enctests ] + branches: [ collab_main ] #pull_request: # branches: [ main ] diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 6fa7af27..c423ee97 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -2,7 +2,7 @@ name: Validation Tests on: push: - branches: [ ut_tc_apply-enctests ] + branches: [ collab_main ] #pull_request: # branches: [ main ] From 821f5e4af8566cad958afa5b96c2630c1e4a2ec0 Mon Sep 17 00:00:00 2001 From: Robert Brown Date: Tue, 7 Dec 2021 17:04:47 -0500 Subject: [PATCH 3/4] CI Fixes --- .github/workflows/build.yml | 7 ++----- .github/workflows/utest.yml | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f44d1d62..a83a61f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ collab_main ] + branches: [ ut_tc_apply-enctests ] #pull_request: # branches: [ main ] @@ -21,10 +21,7 @@ jobs: - uses: actions/checkout@v2 - name: Install Dependencies - run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev python3 - - - name: Install Python Libraries - run: sudo pip install pycryptodome + run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. diff --git a/.github/workflows/utest.yml b/.github/workflows/utest.yml index fd4f2a5a..10d211b0 100644 --- a/.github/workflows/utest.yml +++ b/.github/workflows/utest.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v2 - name: Install Dependencies - run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev python3 + run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 2d8b8b76cd5228e9bc10e9f2fd7d5b3f7ea021c1 Mon Sep 17 00:00:00 2001 From: Robert Brown Date: Tue, 7 Dec 2021 17:06:02 -0500 Subject: [PATCH 4/4] CI Cleanup --- .github/workflows/build.yml | 10 +--------- .github/workflows/utest.yml | 2 -- .github/workflows/validation.yml | 2 -- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a83a61f7..4a960f60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,7 @@ name: Build on: push: - branches: [ ut_tc_apply-enctests ] - #pull_request: - # branches: [ main ] + branches: [ collab_main ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -31,10 +29,4 @@ jobs: - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - #- name: Test - #working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - #run: ctest -C ${{env.BUILD_TYPE}} diff --git a/.github/workflows/utest.yml b/.github/workflows/utest.yml index 10d211b0..51677f00 100644 --- a/.github/workflows/utest.yml +++ b/.github/workflows/utest.yml @@ -3,8 +3,6 @@ name: Unit Tests on: push: branches: [ collab_main ] - #pull_request: - # branches: [ main ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index c423ee97..58178d2b 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -3,8 +3,6 @@ name: Validation Tests on: push: branches: [ collab_main ] - #pull_request: - # branches: [ main ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)