From abdc0166841d386c7e5c0431de0bc38ddacae09e Mon Sep 17 00:00:00 2001 From: "Thing-han, Lim" <15379156+potsrevennil@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:45:51 +0800 Subject: [PATCH] run opt/non-opt in ci Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> --- .github/actions/functest/action.yml | 9 ++++++--- .github/workflows/ci.yml | 7 +++++++ .github/workflows/ci_ec2_any.yml | 5 +++++ .github/workflows/ci_ec2_reusable.yml | 9 +++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/actions/functest/action.yml b/.github/actions/functest/action.yml index 883810b69..2b81aae65 100644 --- a/.github/actions/functest/action.yml +++ b/.github/actions/functest/action.yml @@ -13,6 +13,9 @@ inputs: cross-prefix: description: Binary prefix for cross compilation default: "" + opt: + description: opt flag to pass to test script + default: "true" runs: using: composite steps: @@ -39,7 +42,7 @@ runs: shell: ${{ env.SHELL }} run: | echo "::group::func_test" - tests func --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v + tests func --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} --opt ${{inputs.opt}} -v echo "::endgroup::" - name: Run KAT tests if: | @@ -49,7 +52,7 @@ runs: shell: ${{ env.SHELL }} run: | echo "::group::kat_test" - tests kat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v + tests kat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} --opt ${{inputs.opt}} -v echo "::endgroup::" - name: Run Nistkat tests id: nistkat_test @@ -60,5 +63,5 @@ runs: shell: ${{ env.SHELL }} run: | echo "::group::nistkat_test" - tests nistkat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v + tests nistkat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} --opt ${{inputs.opt}} -v echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d41afce6e..8eceda2a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,13 @@ jobs: use-nix: true cflags: ${{ matrix.target.cflags }} cross-prefix: ${{ matrix.target.cross-prefix }} + opt: true + - uses: ./.github/actions/functest + with: + use-nix: true + cflags: ${{ matrix.target.cflags }} + cross-prefix: ${{ matrix.target.cross-prefix }} + opt: false lint: strategy: matrix: diff --git a/.github/workflows/ci_ec2_any.yml b/.github/workflows/ci_ec2_any.yml index 1b721c98b..42e48108f 100644 --- a/.github/workflows/ci_ec2_any.yml +++ b/.github/workflows/ci_ec2_any.yml @@ -24,6 +24,10 @@ on: cflags: description: Custom CFLAGS for compilation default: + opt: + description: Run with optimized code if enabled + type: boolean + default: true cross-prefix: description: Cross-compilation binary prefix, if any default: ' ' @@ -53,6 +57,7 @@ jobs: ec2_ami_id: ${{ inputs.ec2_ami_id }} cflags: ${{ inputs.cflags }} cross-prefix: ${{ inputs.cross-prefix }} + opt: ${{ inputs.opt }} functest: ${{ inputs.functest }} lint: ${{ inputs.lint }} cbmc: ${{ inputs.cbmc }} diff --git a/.github/workflows/ci_ec2_reusable.yml b/.github/workflows/ci_ec2_reusable.yml index 87bba3e9b..efd1f293c 100644 --- a/.github/workflows/ci_ec2_reusable.yml +++ b/.github/workflows/ci_ec2_reusable.yml @@ -28,6 +28,10 @@ on: type: string description: Cross-compilation binary prefix, if any default: ' ' + opt: + type: boolean + description: Runs with optimized code if enabled. + default: true always_terminate: type: boolean description: Indicates if instance should always be terminated, even on failure @@ -99,8 +103,9 @@ jobs: - uses: ./.github/actions/functest with: use-nix: true - cflags: ${{ matrix.target.cflags }} - cross-prefix: ${{ matrix.target.cross-prefix }} + cflags: ${{ inputs.cflags }} + cross-prefix: ${{ inputs.cross-prefix }} + opt: ${{ inputs.opt }} lint: name: Linting ${{ inputs.name }} needs: start-ec2-runner