diff --git a/.github/actions/setup-apt/action.yml b/.github/actions/setup-apt/action.yml new file mode 100644 index 000000000..a4348deba --- /dev/null +++ b/.github/actions/setup-apt/action.yml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: Apache-2.0 + +name: Dependencies (apt) +description: Install dependencies via apt + +inputs: + packages: + description: Space-separated list of additional packages to install + required: false + default: '' + sudo: + required: false + default: 'sudo' + +runs: + using: composite + steps: + - name: Update package repository + shell: bash + run: | + ${{ inputs.sudo }} apt-get update + - name: Install base packages + shell: bash + run: | + ${{ inputs.sudo }} apt-get install python3-venv python3-pip make -y + - name: Install additional packages + if: ${{ inputs.packages != ''}} + shell: bash + run: | + ${{ inputs.sudo }} apt-get install ${{ inputs.packages }} -y + - name: Setup Python venv + shell: bash + run: | + python3 -m venv venv + source venv/bin/activate + python3 -m pip install -r requirements.txt + deactivate + echo "$(pwd)/venv/bin/" >> "$GITHUB_PATH" diff --git a/.github/actions/setup-ubuntu/action.yml b/.github/actions/setup-apt/action.yml~ similarity index 100% rename from .github/actions/setup-ubuntu/action.yml rename to .github/actions/setup-apt/action.yml~ diff --git a/.github/actions/setup-os/action.yml b/.github/actions/setup-os/action.yml index 1f9243fab..864887d93 100644 --- a/.github/actions/setup-os/action.yml +++ b/.github/actions/setup-os/action.yml @@ -25,13 +25,13 @@ runs: fi - name: Setup via yum if: ${{ env.PKG == 'yum' }} - uses: ./.github/actions/setup-ubuntu + uses: ./.github/actions/setup-yum with: packages: ${{ inputs.packages }} sudo: ${{ inputs.sudo }} - name: Setup via apt if: ${{ env.PKG == 'apt' }} - uses: ./.github/actions/setup-ubuntu + uses: ./.github/actions/setup-apt with: packages: ${{ inputs.packages }} sudo: ${{ inputs.sudo }} diff --git a/.github/actions/setup-al/action.yml b/.github/actions/setup-yum/action.yml similarity index 82% rename from .github/actions/setup-al/action.yml rename to .github/actions/setup-yum/action.yml index e58884f73..16f9c3eda 100644 --- a/.github/actions/setup-al/action.yml +++ b/.github/actions/setup-yum/action.yml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -name: Setup Amazon Linux -description: Setup Amazon Linux +name: Dependencies (yum) +description: Install dependencies via yum inputs: packages: @@ -16,10 +16,9 @@ runs: using: composite steps: - name: Install base packages - - name: Update package repository shell: bash run: | - ${{ inputs.sudo }} yum install make git python3-venv -y + ${{ inputs.sudo }} yum install make git python3-pip -y ${{ inputs.sudo }} pip3 install virtualenv - name: Install additional packages if: ${{ inputs.packages != ''}} diff --git a/.github/workflows/bench_ec2_reusable.yml b/.github/workflows/bench_ec2_reusable.yml index 7da9c19f7..9205c85c8 100644 --- a/.github/workflows/bench_ec2_reusable.yml +++ b/.github/workflows/bench_ec2_reusable.yml @@ -165,7 +165,7 @@ jobs: if: ${{ inputs.compiler != '' }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: ./.github/actions/setup-ubuntu + - uses: ./.github/actions/setup-apt with: packages: ${{ inputs.additional_packages }} - name: Set compiler diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d72bd135..06b72aaa0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: OPT=0 make quickcheck >/dev/null make clean >/dev/null OPT=1 make quickcheck >/dev/null - - uses: ./.github/actions/setup-ubuntu + - uses: ./.github/actions/setup-apt - name: tests func run: | ./scripts/tests func @@ -93,7 +93,7 @@ jobs: OPT=0 CPPFLAGS=-std=c90 make quickcheck >/dev/null make clean >/dev/null OPT=1 CPPFLAGS=-std=c90 make quickcheck >/dev/null - - uses: ./.github/actions/setup-ubuntu + - uses: ./.github/actions/setup-apt - name: tests func run: | CPPFLAGS="-std=c90" ./scripts/tests func @@ -434,22 +434,60 @@ jobs: # lint: false # verbose: true # secrets: inherit + compatibility_tests: + strategy: + max-parallel: 4 + fail-fast: false + matrix: + container: + - id: fedora:38 + - id: fedora:39 + - id: fedora:40 + name: Compatibility tests (${{ matrix.container.id }}) + runs-on: ubuntu-latest + container: + ${{ inputs.container }} + steps: + - name: Manual checkout + shell: bash + run: | + if which yum; then + yum install git -y + elif which apt; then + apt update + apt install git -y + fi + + git init + git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY + git fetch origin --depth 1 $GITHUB_SHA + git checkout FETCH_HEAD + - uses: ./.github/actions/setup-os + with: + sudo: "" + - name: make quickcheck + run: | + OPT=0 make quickcheck >/dev/null + make clean >/dev/null + OPT=1 make quickcheck >/dev/null + - name: Functional Tests + uses: ./.github/actions/multi-functest + with: + nix-shell: "" + gh_token: ${{ secrets.AWS_GITHUB_TOKEN }} + cflags: ${{ inputs.cflags }} + compile_mode: ${{ inputs.compile_mode }} + opt: ${{ inputs.opt }} + func: ${{ inputs.functest }} + kat: ${{ inputs.kattest }} + nistkat: ${{ inputs.nistkattest }} + acvp: ${{ inputs.acvptest }} ec2_compatibilitytests: strategy: + max-parallel: 8 fail-fast: false matrix: container: - # - id: ubuntu-22.04-aarch:gcc-12x - # - id: ubuntu-22.04-aarch:gcc-11x - # - id: ubuntu-20.04-aarch:gcc-8x - # - id: ubuntu-20.04-aarch:gcc-7x - # - id: ubuntu-20.04-aarch:clang-9x - # - id: ubuntu-20.04-aarch:clang-8x - # - id: ubuntu-20.04-aarch:clang-7x-bm-framework - # - id: ubuntu-20.04-aarch:clang-7x - # - id: ubuntu-20.04-aarch:clang-10x - # - id: ubuntu-22.04-aarch:base - - id: ubuntu-20.04-aarch:base - id: amazonlinux-2-aarch:base - id: amazonlinux-2-aarch:gcc-7x - id: amazonlinux-2-aarch:clang-7x @@ -457,7 +495,18 @@ jobs: - id: amazonlinux-2023-aarch:gcc-11x - id: amazonlinux-2023-aarch:clang-15x - id: amazonlinux-2023-aarch:clang-15x-sanitizer - - id: amazonlinux-2023-aarch:cryptofuzz + # - id: amazonlinux-2023-aarch:cryptofuzz Not yet supported + - id: ubuntu-22.04-aarch:gcc-12x + - id: ubuntu-22.04-aarch:gcc-11x + - id: ubuntu-20.04-aarch:gcc-8x + - id: ubuntu-20.04-aarch:gcc-7x + - id: ubuntu-20.04-aarch:clang-9x + - id: ubuntu-20.04-aarch:clang-8x + - id: ubuntu-20.04-aarch:clang-7x-bm-framework + - id: ubuntu-20.04-aarch:clang-7x + - id: ubuntu-20.04-aarch:clang-10x + - id: ubuntu-22.04-aarch:base + - id: ubuntu-20.04-aarch:base name: Compatibility tests (${{ matrix.container.id }}) # needs: [ec2_functests] permissions: diff --git a/.github/workflows/ci_ec2_reusable.yml b/.github/workflows/ci_ec2_reusable.yml index 8cc80ca05..0d6684938 100644 --- a/.github/workflows/ci_ec2_reusable.yml +++ b/.github/workflows/ci_ec2_reusable.yml @@ -123,7 +123,7 @@ jobs: container: localhost:5000/${{ inputs.container }} steps: - - name: Setup system + - name: Manual checkout shell: bash run: | if which yum; then @@ -137,28 +137,9 @@ jobs: git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY git fetch origin --depth 1 $GITHUB_SHA git checkout FETCH_HEAD - - if which yum; then - yum install make git python3-pip -y - pip3 install virtualenv - virtualenv venv - source venv/bin/activate - python3 -m pip install -r requirements.txt - elif which apt; then - apt update - apt install make python3-pip python3-venv -y - python3 -m venv venv - source venv/bin/activate - python3 -m pip install -r requirements.txt - fi - - python3 --version - - echo "$(pwd)/venv/bin/" >> "$GITHUB_PATH" - - # - uses: ./.github/actions/setup-os - # with: - # sudo: "" + - uses: ./.github/actions/setup-os + with: + sudo: "" - name: make quickcheck run: | OPT=0 make quickcheck >/dev/null @@ -176,7 +157,6 @@ jobs: kat: ${{ inputs.kattest }} nistkat: ${{ inputs.nistkattest }} acvp: ${{ inputs.acvptest }} - tests: name: Run tests needs: start-ec2-runner