From 99f1d83141a6e1a885476da4bbf69f0757e9f0bd Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 15 May 2024 17:56:20 -0700 Subject: [PATCH] Kyber Testing 1. Updated to use more standard actions. 2. Cache the outputs of the dependencies. --- .github/workflows/kyber.yml | 82 ++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/.github/workflows/kyber.yml b/.github/workflows/kyber.yml index 81491c4cd..de79fed00 100644 --- a/.github/workflows/kyber.yml +++ b/.github/workflows/kyber.yml @@ -12,47 +12,75 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 4 steps: - - name: Install liboqs source - run: git clone --depth 1 --branch "0.10.0" "https://github.com/open-quantum-safe/liboqs" + - name: Checking cache for liboqs + uses: actions/cache/restore@v4 + id: cache + with: + path: ${{ github.workspace }}/opt/liboqs/ + key: wolfssh-liboqs-${{ runner.os }} + lookup-only: true + + - name: Checkout liboqs + if: steps.cache.output.cache-hit != 'true' + uses: actions/checkout@v4 + with: + repository: open-quantum-safe/liboqs + ref: 0.10.0 + path: liboqs - name: Build and install liboqs + if: steps.cache.output.cache-hit != 'true' working-directory: liboqs run: | mkdir build cd build - cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/opt -DOQS_MINIMAL_BUILD=KEM_kyber_512 -DOQS_USE_OPENSSL=0 .. + cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/opt/liboqs -DOQS_MINIMAL_BUILD=KEM_kyber_512 -DOQS_USE_OPENSSL=0 .. make make install - - name: Upload liboqs - uses: actions/upload-artifact@v4 + - name: Stash liboqs in cache + if: steps.cache.output.cache-hit != 'true' + uses: actions/cache/save@v4 with: - name: wolfssh-liboqs - path: ${{ github.workspace }}/opt/ - retention-days: 3 + path: ${{ github.workspace }}/opt/liboqs/ + key: wolfssh-liboqs-${{ runner.os }} build_wolfssl: name: Build wolfssl runs-on: ubuntu-latest timeout-minutes: 4 steps: - - name: Install wolfssl source - run: git clone --depth 1 "https://github.com/wolfssl/wolfssl" + - name: Checking cache for wolfssl + uses: actions/cache/restore@v4 + id: cache + with: + path: ${{ github.workspace }}/opt/wolfssl/ + key: wolfssh-wolfssl-${{ runner.os }} + lookup-only: true + + - name: Checkout wolfssl + if: steps.cache.output.cache-hit != 'true' + uses: actions/checkout@v4 + with: + repository: wolfssl/wolfssl + ref: 5.7.0-stable + path: wolfssl - name: Build and install wolfssl + if: steps.cache.output.cache-hit != 'true' working-directory: wolfssl run: | autoreconf -ivf - ./configure --prefix=${{ github.workspace }}/opt --enable-wolfssh --enable-cryptonly --disable-examples --disable-crypttests + ./configure --prefix=${{ github.workspace }}/opt/wolfssl --enable-wolfssh --enable-cryptonly --disable-examples --disable-crypttests make make install - - name: Upload wolfssl - uses: actions/upload-artifact@v4 + - name: Stash wolfssl in cache + if: steps.cache.output.cache-hit != 'true' + uses: actions/cache/save@v3 with: - name: wolfssh-wolfssl - path: ${{ github.workspace}}/opt/ - retention-days: 3 + path: ${{ github.workspace }}/opt/wolfssl/ + key: wolfssh-wolfssl-${{ runner.os }} build_wolfssh: name: Build wolfssh @@ -60,17 +88,21 @@ jobs: timeout-minutes: 4 needs: [build_wolfssl, build_liboqs] steps: - - name: Download wolfssl - uses: actions/download-artifact@v4 + - name: Checking cache for liboqs + uses: actions/cache/restore@v4 + id: cache with: - name: wolfssh-wolfssl - path: ${{ github.workspace }}/opt/ + path: opt/liboqs + key: wolfssh-liboqs-${{ runner.os }} + fail-on-cache-miss: true - - name: Download liboqs - uses: actions/download-artifact@v4 + - name: Checking cache for wolfssl + uses: actions/cache/restore@v4 + id: cache with: - name: wolfssh-liboqs - path: ${{ github.workspace }}/opt/ + path: opt/wolfssl + key: wolfssh-wolfssl-${{ runner.os }} + fail-on-cache-miss: true - name: Install wolfSSH run: git clone --depth 1 "https://github.com/wolfssl/wolfssh" @@ -79,7 +111,7 @@ jobs: working-directory: wolfssh run: | autoreconf -ivf - ./configure --with-liboqs=${{ github.workspace }}/opt LDFLAGS=-L${{ github.workspace }}/opt/lib CPPFLAGS=-I${{ github.workspace }}/opt/include + ./configure --with-liboqs LDFLAGS="-L${{ github.workspace }}/opt/liboqs/lib -L${{ github.workspace }}/opt/wolfssl/lib CPPFLAGS="-I${{ github.workspace }}/opt/liboqs/include -I${{ github.workspace }}/opt/wolfssl/include" make - name: Run wolfssh tests