Skip to content

Commit

Permalink
clang test
Browse files Browse the repository at this point in the history
  • Loading branch information
hanno-becker committed Oct 17, 2024
1 parent 09b50fe commit f805e1c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/actions/bench/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ runs:
- name: Run benchmark
shell: ${{ env.SHELL }}
run: |
tests bench -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
./scripts/tests bench -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
--cflags="${{ inputs.cflags }}" --arch-flags="${{ inputs.archflags }}" \
$([[ ${{ inputs.opt }} == "false" ]] && echo "--no-opt") \
-v --output=output.json ${{ inputs.bench_extra_args }}
tests bench --components -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
./scripts/tests bench --components -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
--cflags="${{ inputs.cflags }}" --arch-flags="${{ inputs.archflags }}" \
$([[ ${{ inputs.opt }} == "false" ]] && echo "--no-opt") \
-v --output=output.json ${{ inputs.bench_extra_args }}
Expand Down
9 changes: 3 additions & 6 deletions .github/actions/setup-shell/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ name: Set Shell
description: Setup nix or custom shell for workflows

inputs:
use-nix:
description: Indicate whether to use nix or not
default: 'true'
nix-shell:
description: Run in the specified Nix environment if exists
description: Run in the specified Nix environment if exists. If empty, custom shell will be used instead of nix.
default: 'ci'
nix-cache:
description: Determine whether to enable nix cache
Expand All @@ -28,15 +25,15 @@ runs:
steps:
- name: Setup nix
uses: ./.github/actions/setup-nix
if: ${{ inputs.use-nix == 'true' && (env.SHELL == '' || env.Nix_SHELL != inputs.nix-shell) }}
if: ${{ inputs.nix-shell != '' }}
with:
devShell: ${{ inputs.nix-shell }}
verbose: ${{ inputs.nix-verbose }}
cache: ${{ inputs.nix-cache }}
script: ${{ inputs.script }}
- name: Set custom shell
shell: bash
if: ${{ inputs.use-nix != 'true' && env.SHELL == '' }}
if: ${{ inputs.nix-shell == '' }}
run: |
echo SHELL="${{ inputs.custom_shell }}" >> $GITHUB_ENV
Expand Down
48 changes: 42 additions & 6 deletions .github/workflows/bench_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,54 @@ jobs:
ec2-instance-type: ${{ inputs.ec2_instance_type }}
subnet-id: subnet-07b2729e5e065962f
security-group-id: sg-0ab2e297196c8c381
bench:
name: Bench ${{ inputs.name }}
# 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:
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
- name: Install clang
run: |
sudo apt-get update
sudo apt-get install python3-venv python3-pip make clang-18 -y
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
# deactivate
export CC=clang-18
# export BASH_ENV=$(pwd)/venv/bin/activate
- name: test
runs: |
which python3
echo $CC
- uses: ./.github/actions/bench
with:
nix-shell: bench
nix-shell: ''
custom-shell: 'bash'
nix-cache: false
nix-verbose: ${{ inputs.verbose }}
name: ${{ inputs.name }}
cflags: ${{ inputs.cflags }}
name: ${{ inputs.name }} (clang-18)
cflags: ${{ inputs.cflags }} -mtune=native -march=native
archflags: ${{ inputs.archflags }}
opt: ${{ inputs.opt }}
perf: PERF
Expand All @@ -125,7 +160,8 @@ jobs:
id-token: 'write'
needs:
- start-ec2-runner
- bench # required to wait when the main job is done
# - bench_nix # required to wait when the main job is done
- bench_clang # 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:
Expand Down

0 comments on commit f805e1c

Please sign in to comment.