Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nasa/cryptolib#167] Container Builds #176

Merged
merged 14 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 50 additions & 140 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,166 +1,76 @@
name: Build
name: CryptoLib

on:
push:
branches: [ main, dev ]
pull_request:

jobs:
debug_libgcrypt_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: Update
run: sudo apt-get update

- name: Install Dependencies
run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev libmariadb-dev libmariadb-dev-compat

- 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 -DDEBUG=1 -DSA_MARIADB=0 -DCRYPTO_LIBGCRYPT=1 -DCRYPTO_KMC=0 -DTEST=1

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

- 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}}
libgcrypt_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update
run: sudo apt-get update

- name: Install Dependencies
run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev libmariadb-dev libmariadb-dev-compat libcurl4-openssl-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.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DDEBUG=0 -DSA_MARIADB=0 -DCRYPTO_LIBGCRYPT=1 -DCRYPTO_KMC=0 -DTEST=1

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

- 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}}

sql_libgcrypt_debug_build:
#
# Minimal Build
#
minimal_build:
# Container Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update
run: sudo apt-get update

- name: Install Dependencies
run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev libmariadb-dev libmariadb-dev-compat libcurl4-openssl-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.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DDEBUG=1 -DSA_MARIADB=1 -DCRYPTO_LIBGCRYPT=1 -DCRYPTO_KMC=0 -DTEST=1

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

- 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}}
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3
- name: Install Python Libraries
run: sudo pip install pycryptodome
# End Container Setup

sql_libgcrypt_build:
- name: Minimal Build Script
working-directory: ${{github.workspace}}
run: bash ${GITHUB_WORKSPACE}/support/scripts/build_minimal.sh

#
# Internal Build
#
internal_build:
# Container Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update
run: sudo apt-get update

- name: Install Dependencies
run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev libmariadb-dev libmariadb-dev-compat libcurl4-openssl-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.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DDEBUG=0 -DSA_MARIADB=1 -DCRYPTO_LIBGCRYPT=1 -DCRYPTO_KMC=0 -DTEST=1

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

- 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}}

sql_libgcrypt_kmc_debug_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update
run: sudo apt-get update

- name: Install Dependencies
run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev libmariadb-dev libmariadb-dev-compat libcurl4-openssl-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.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DDEBUG=1 -DSA_MARIADB=1 -DCRYPTO_LIBGCRYPT=1 -DCRYPTO_KMC=1 -DTEST=1

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

- 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}}

sql_libgcrypt_kmc_build:
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3
- name: Install Python Libraries
run: sudo pip install pycryptodome
# End Container Setup

- name: Internal Build Script
working-directory: ${{github.workspace}}
run: bash ${GITHUB_WORKSPACE}/support/scripts/build_internal.sh

- name: Code-Coverage
working-directory: ${{github.workspace}}
run: make gcov

- name: Upload
uses: codecov/codecov-action@v1
with:
files: 'coverage/*.c.gcov'

#
# KMC Build
#
kmc_build:
# Container Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update
run: sudo apt-get update

- name: Install Dependencies
run: sudo apt-get install -y libgpg-error-dev libgcrypt20-dev libmariadb-dev libmariadb-dev-compat libcurl4-openssl-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.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DDEBUG=0 -DSA_MARIADB=1 -DCRYPTO_LIBGCRYPT=1 -DCRYPTO_KMC=1 -DTEST=1

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build

- 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}}
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3
- name: Install Python Libraries
run: sudo pip install pycryptodome
# End Container Setup

- name: KMC Build Script
working-directory: ${{github.workspace}}
run: bash ${GITHUB_WORKSPACE}/support/scripts/build_kmc.sh
83 changes: 0 additions & 83 deletions .github/workflows/utest.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/validation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__pycache__
*.dat
*.so
build*
build/
venv
vgcore*
core.*
2 changes: 0 additions & 2 deletions src/key/kmc/key_interface_kmc.template.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "key_interface.h"

/* Variables */
static crypto_key_t ek_ring[NUM_KEYS] = {0};
static KeyInterfaceStruct key_if_struct;

/* Prototypes */
Expand All @@ -40,7 +39,6 @@ static crypto_key_t* get_key(uint32_t key_id)
{
/* Avoid set but not used warning */
key_id = key_id;
key_ptr = key_ptr;

fprintf(stderr, "Attempting to access key ring with KMC Crypto Service. This shouldn't happen!\n ");

Expand Down
Loading