Skip to content

Commit

Permalink
Encapsulate airspeedvelocity logic in a script
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzovarese committed Sep 13, 2024
1 parent 187d795 commit e827f75
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
14 changes: 2 additions & 12 deletions ci/cscs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,8 @@ run_tests:
script:
- . /opt/gridtools_jl_env/setup-env.sh
- cd /opt/GridTools
- julia -e 'using Pkg; Pkg.add("AirspeedVelocity"); Pkg.build("AirspeedVelocity")'
- export PATH="\$PATH:\$HOME/.julia/bin"
- echo "Updated PATH: \$PATH"
- julia --project=. -e 'using Pkg; Pkg.test()'
- mkdir -p results
- git fetch origin main:refs/remotes/origin/main
- CURRENT_COMMIT=$(git rev-parse HEAD)
- LAST_MAIN_COMMIT=$(git rev-parse origin/main)
- echo "Benchmarking current commit (\$CURRENT_COMMIT) in the current branch and (\$LAST_MAIN_COMMIT) in the main branch"
- benchpkg --rev="\$LAST_MAIN_COMMIT,\$CURRENT_COMMIT" --bench-on="\$CURRENT_COMMIT" --output-dir=results/
- echo "Creating benchmark table comparing current commit (\$CURRENT_COMMIT) against (\$LAST_MAIN_COMMIT) in the main branch"
- benchpkgtable --rev="\$LAST_MAIN_COMMIT,\$CURRENT_COMMIT" --input-dir=results/ --ratio
- chmod +x ci/run_airspeedvelocity.sh
- ./ci/run_airspeedvelocity.sh
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
Expand Down
30 changes: 30 additions & 0 deletions ci/run_airspeedvelocity.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Install and build the AirspeedVelocity package in Julia
echo "Installing and building AirspeedVelocity..."
julia -e 'using Pkg; Pkg.add("AirspeedVelocity"); Pkg.build("AirspeedVelocity")'

# Update the PATH to include the Julia binary directory
export PATH="$PATH:$HOME/.julia/bin"

# Optional: Print the updated PATH
echo "Updated PATH: $PATH"

# Create results directory
mkdir -p results

# Fetch the latest main branch
echo "Fetching the latest main branch..."
git fetch origin main:refs/remotes/origin/main

# Get the current commit and the last main commit
CURRENT_COMMIT=$(git rev-parse HEAD)
LAST_MAIN_COMMIT=$(git rev-parse origin/main)

# Benchmark the current commit against the last main commit
echo "Benchmarking current commit ($CURRENT_COMMIT) in the current branch and ($LAST_MAIN_COMMIT) in the main branch..."
benchpkg --rev="$LAST_MAIN_COMMIT,$CURRENT_COMMIT" --bench-on="$CURRENT_COMMIT" --output-dir=results/

# Create a benchmark table comparing the current commit against the last main commit
echo "Creating benchmark table comparing current commit ($CURRENT_COMMIT) against ($LAST_MAIN_COMMIT) in the main branch..."
benchpkgtable --rev="$LAST_MAIN_COMMIT,$CURRENT_COMMIT" --input-dir=results/ --ratio

0 comments on commit e827f75

Please sign in to comment.