Skip to content

Commit

Permalink
fix weekly.yml and unix.yml to test libjade code
Browse files Browse the repository at this point in the history
Signed-off-by: Pravek Sharma <[email protected]>
  • Loading branch information
praveksharma committed Apr 22, 2024
1 parent 3f43116 commit 93877fb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 15 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Linux and MacOS tests

on: [push, pull_request, workflow_dispatch]

env:
# Semi-colon separated list of algorithims with libjade implementations to
# be passed as input to CMake option as: -DOQS_MINIMAL_BUILD=$LIBJADE_ALG_LIST
# See CONFIGURE.md under ## OQS_MINIMAL_BUILD
LIBJADE_ALG_LIST: "KEM_kyber_512;KEM_kyber_768"

jobs:

stylecheck:
Expand All @@ -20,6 +26,12 @@ jobs:

upstreamcheck:
name: Check upstream code is properly integrated
strategy:
fail-fast: false
matrix:
copy-mode:
- copy
- libjade
container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
runs-on: ubuntu-latest
steps:
Expand All @@ -31,25 +43,15 @@ jobs:
nix-channel --update && nix-env -iA nixpkgs.jasmin-compiler
- name: Checkout code
uses: actions/checkout@v4
- name: Verify copy_from_upstream state after "copy"
- name: Verify copy_from_upstream state after "${{ matrix.copy-mode}}"
run: |
git config --global user.name "ciuser" && \
git config --global user.email "[email protected]" && \
export LIBOQS_DIR=`pwd` && \
git config --global --add safe.directory $LIBOQS_DIR && \
cd scripts/copy_from_upstream && \
! pip3 install -r requirements.txt 2>&1 | grep ERROR && \
python3 copy_from_upstream.py copy && \
! git status | grep modified
- name: Verify copy_from_upstream state after "libjade"
run: |
git config --global user.name "ciuser" && \
git config --global user.email "[email protected]" && \
export LIBOQS_DIR=`pwd` && \
git config --global --add safe.directory $LIBOQS_DIR && \
cd scripts/copy_from_upstream && \
! pip3 install -r requirements.txt 2>&1 | grep ERROR && \
python3 copy_from_upstream.py libjade && \
python3 copy_from_upstream.py ${{ matrix.copy-mode }} && \
! git status | grep modified
buildcheck:
Expand Down Expand Up @@ -112,13 +114,18 @@ jobs:
container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
CMAKE_ARGS: -DCMAKE_C_COMPILER=clang-9 -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZER=Address
PYTEST_ARGS: --ignore=tests/test_distbuild.py --ignore=tests/test_leaks.py --ignore=tests/test_kat_all.py --numprocesses=auto --maxprocesses=10
libjade-build:
- -DOQS_LIBJADE_BUILD=OFF
# Restrict -DOQS_LIBJADE_BUILD=ON build to algs provided by
# libjade to minimise repeated tests
- -DOQS_LIBJADE_BUILD=ON -DOQS_MINIMAL_BUILD=$LIBJADE_ALG_LIST
container:
image: ${{ matrix.container }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} .. && cmake -LA ..
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} ${{ matrix.libjade-build }} .. && cmake -LA ..
- name: Build
run: ninja
working-directory: build
Expand Down Expand Up @@ -218,6 +225,11 @@ jobs:
- -DCMAKE_C_COMPILER=gcc-13
- -DOQS_USE_OPENSSL=OFF
- -DBUILD_SHARED_LIBS=ON -DOQS_DIST_BUILD=OFF
libjade-build:
- -DOQS_LIBJADE_BUILD=OFF
# Restrict -DOQS_LIBJADE_BUILD=ON build to algs provided by
# libjade to minimise repeated tests
- -DOQS_LIBJADE_BUILD=ON -DOQS_MINIMAL_BUILD=$LIBJADE_ALG_LIST
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand All @@ -227,7 +239,7 @@ jobs:
- name: Get system information
run: sysctl -a | grep machdep.cpu
- name: Configure
run: mkdir -p build && cd build && source ~/.bashrc && cmake -GNinja -DOQS_STRICT_WARNINGS=ON ${{ matrix.CMAKE_ARGS }} .. && cmake -LA ..
run: mkdir -p build && cd build && source ~/.bashrc && cmake -GNinja -DOQS_STRICT_WARNINGS=ON ${{ matrix.CMAKE_ARGS }} ${{ matrix.libjade-build }} .. && cmake -LA ..
- name: Build
run: ninja
working-directory: build
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
- cron: "5 0 * * 0"
workflow_dispatch:

env:
# Semi-colon separated list of algorithims with libjade implementations to
# be passed as input to CMake option as: -DOQS_MINIMAL_BUILD=$LIBJADE_ALG_LIST
# See CONFIGURE.md under ## OQS_MINIMAL_BUILD
LIBJADE_ALG_LIST: "KEM_kyber_512;KEM_kyber_768"

jobs:

constant-time-x64:
Expand Down Expand Up @@ -51,13 +57,18 @@ jobs:
container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
CMAKE_ARGS: -DOQS_DIST_BUILD=OFF -DOQS_OPT_TARGET=haswell
PYTEST_ARGS: --numprocesses=auto -k 'test_kat_all'
libjade-build:
- -DOQS_LIBJADE_BUILD=OFF
# Restrict -DOQS_LIBJADE_BUILD=ON build to algs provided by
# libjade to minimise repeated tests
- -DOQS_LIBJADE_BUILD=ON -DOQS_MINIMAL_BUILD=$LIBJADE_ALG_LIST
container:
image: ${{ matrix.container }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} .. && cmake -LA ..
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} ${{ matrix.libjade-build }}.. && cmake -LA ..
- name: Build
run: ninja
working-directory: build
Expand Down
2 changes: 2 additions & 0 deletions scripts/copy_from_upstream/copy_from_libjade.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# When adding an algorithm to copy_from_libjade.yml, the boolean
# 'libjade_implementation' and list of implementation 'libjade_implementations'
# must updated for the relevant algorithm in copy_from_upstream.yml
# Additionaly, the algorithm name must be appended to env.LIBJADE_ALG_LIST
# in the unix.yml and weekly.yml GitHub Actions workflows
upstreams:
-
name: libjade
Expand Down

0 comments on commit 93877fb

Please sign in to comment.