From 8a5fd0595ac407418f8259798e415a0b3f3756ea Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 17 Oct 2024 06:09:15 +0100 Subject: [PATCH] test Signed-off-by: Hanno Becker --- .github/workflows/bench_ec2_any.yml | 15 +++--- .github/workflows/bench_ec2_reusable.yml | 66 +++++++++++++----------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/.github/workflows/bench_ec2_any.yml b/.github/workflows/bench_ec2_any.yml index 8c4c1e2fc..944414069 100644 --- a/.github/workflows/bench_ec2_any.yml +++ b/.github/workflows/bench_ec2_any.yml @@ -32,15 +32,14 @@ on: description: Run with optimized code if enabled type: boolean default: true - verbose: - description: Determine for the log verbosity - type: boolean - default: false bench_extra_args: description: Additional command line to be appended to `tests bench` script default: '' - cross_prefix: - description: "Binary prefix for cross-compilation builds" + compiler: + description: Compiler to use. When unset, default nix shell is used. + default: '' + additional_packages: + description: Additional packages to install when custom compiler is used. default: '' jobs: bench-ec2-any: @@ -55,7 +54,7 @@ jobs: opt: ${{ inputs.opt }} name: ${{ inputs.name }} store_results: false - verbose: ${{ inputs.verbose }} bench_extra_args: ${{ inputs.bench_extra_args }} - cross_prefix: ${{ inputs.cross_prefix }} + compiler: ${{ inputs.compiler }} + additional_packages: ${{ inputs.additional_packages }} secrets: inherit diff --git a/.github/workflows/bench_ec2_reusable.yml b/.github/workflows/bench_ec2_reusable.yml index 1c56e78a4..2f9d6fe70 100644 --- a/.github/workflows/bench_ec2_reusable.yml +++ b/.github/workflows/bench_ec2_reusable.yml @@ -44,9 +44,13 @@ on: type: string description: Additional command line to be appended to `bench` script default: '' - cross_prefix: + compiler: type: string - description: "Binary prefix for cross-compilation builds" + description: Compiler to use. When unset, default nix shell is used. + default: '' + additional_packages: + type: string + description: Additional packages to install when custom compiler is used. default: '' env: AWS_ROLE: arn:aws:iam::559050233797:role/mlkem-c-aarch64-gh-action @@ -98,53 +102,53 @@ jobs: ec2-instance-type: ${{ inputs.ec2_instance_type }} subnet-id: subnet-07b2729e5e065962f security-group-id: sg-0ab2e297196c8c381 - # bench_nix: - # name: Bench nix ${{ inputs.name }} - # runs-on: ${{ needs.start-ec2-runner.outputs.label }} - # needs: start-ec2-runner # required to start the main job when the runner is ready - # steps: - # - uses: actions/checkout@v4 - # - uses: ./.github/actions/bench - # with: - # nix-shell: bench - # nix-cache: false - # nix-verbose: ${{ inputs.verbose }} - # name: ${{ inputs.name }} - # cflags: ${{ inputs.cflags }} - # archflags: ${{ inputs.archflags }} - # opt: ${{ inputs.opt }} - # perf: PERF - # store_results: ${{ inputs.store_results }} - # bench_extra_args: ${{ inputs.bench_extra_args }} - # gh_token: ${{ secrets.AWS_GITHUB_TOKEN }} - # cross_prefix: ${{ inputs.cross_prefix }} - bench_clang: + bench_nix: + name: Bench nix ${{ inputs.name }} + runs-on: ${{ needs.start-ec2-runner.outputs.label }} + needs: start-ec2-runner # required to start the main job when the runner is ready + if: ${{ inputs.compiler == '' }} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/bench + with: + nix-shell: bench + nix-cache: false + nix-verbose: ${{ inputs.verbose }} + name: ${{ inputs.name }} + cflags: ${{ inputs.cflags }} + archflags: ${{ inputs.archflags }} + opt: ${{ inputs.opt }} + perf: PERF + store_results: ${{ inputs.store_results }} + bench_extra_args: ${{ inputs.bench_extra_args }} + gh_token: ${{ secrets.AWS_GITHUB_TOKEN }} + bench_custom: name: Bench nix ${{ inputs.name }} runs-on: ${{ needs.start-ec2-runner.outputs.label }} needs: start-ec2-runner # required to start the main job when the runner is ready + if: ${{ inputs.compiler != '' }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-ubuntu with: - packages: clang-18 - - name: Set clang-18 as default + packages: ${{ inputs.additional_packages }} + - name: Set compiler run: | - echo "CC=clang-18" >> "$GITHUB_ENV" + echo "CC=${{ inputs.compiler }}" >> "$GITHUB_ENV" - uses: ./.github/actions/bench with: nix-shell: '' custom-shell: 'bash' nix-cache: false nix-verbose: ${{ inputs.verbose }} - name: ${{ inputs.name }} (clang-18) - cflags: ${{ inputs.cflags }} -mtune=native -march=native -Wno-unused-command-line-argument + name: ${{ inputs.name }} (${{ inputs.compiler }}) + cflags: ${{ inputs.cflags }} archflags: ${{ inputs.archflags }} opt: ${{ inputs.opt }} perf: PERF store_results: ${{ inputs.store_results }} bench_extra_args: ${{ inputs.bench_extra_args }} gh_token: ${{ secrets.AWS_GITHUB_TOKEN }} - cross_prefix: ${{ inputs.cross_prefix }} stop-ec2-runner: name: Stop ${{ inputs.name }} (${{ inputs.ec2_instance_type }}) permissions: @@ -152,8 +156,8 @@ jobs: id-token: 'write' needs: - start-ec2-runner - # - bench_nix # required to wait when the main job is done - - bench_clang # required to wait when the main job is done + - bench_nix # required to wait when the main job is done + - bench_custom # required to wait when the main job is done runs-on: ubuntu-latest if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs steps: