Skip to content

Commit

Permalink
ci: test for reproducible build (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks authored Jan 23, 2025
1 parent ee04ab2 commit 8c3d2b7
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
- name: build ROOT
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
cmake -S root_src -B build -G Ninja --install-prefix $(pwd)/root -DCMAKE_CXX_STANDARD=17
cmake -S root_src -B build -G Ninja --install-prefix $GITHUB_WORKSPACE/root -DCMAKE_CXX_STANDARD=17
cmake --build build
cmake --install build
tar caf root{.tar.zst,}
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
run: |
iguana_src/.github/install-dependency-packages.sh ${{ inputs.runner }} ${{ inputs.verset }}
[ "${{ matrix.root_dep }}" = "withROOT" ] && source root/bin/thisroot.sh
meson setup build hipo_src --prefix=$(pwd)/hipo -Dbuildtype=debug -Db_pie=true # using PIE build, for sanitizer readibility
meson setup build hipo_src --prefix=$GITHUB_WORKSPACE/hipo -Dbuildtype=debug -Db_pie=true # using PIE build, for sanitizer readibility
meson install -C build
tar cavf hipo{.tar.zst,}
### cache save
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
if: ${{ steps.cache.outputs.cache-hit != 'true' && inputs.verset == 'minver' }}
run: |
iguana_src/.github/install-dependency-packages.sh ${{ inputs.runner }} ${{ inputs.verset }}
export RBENV_ROOT=$(pwd)/.rbenv
export RBENV_ROOT=$GITHUB_WORKSPACE/.rbenv
git clone https://github.com/rbenv/rbenv.git $RBENV_ROOT
eval "$($RBENV_ROOT/bin/rbenv init - bash)"
git clone https://github.com/rbenv/ruby-build.git $(rbenv root)/plugins/ruby-build
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
if: ${{ inputs.id != 'macOS' && inputs.verset == 'minver' }}
run: |
tar xf ruby.tar.zst
export RBENV_ROOT=$(pwd)/.rbenv
export RBENV_ROOT=$GITHUB_WORKSPACE/.rbenv
echo RBENV_ROOT=$RBENV_ROOT >> $GITHUB_ENV
eval "$($RBENV_ROOT/bin/rbenv init - bash)"
echo "ruby --version:"
Expand Down Expand Up @@ -379,17 +379,17 @@ jobs:
### build
- name: meson setup
run: |
meson setup iguana_build iguana_src \
--prefix=$(pwd)/iguana \
--pkg-config-path=$(pwd)/hipo/lib/pkgconfig \
-Drcdb:home=${{ steps.rcdb.outputs.prefix }} \
-Dz_require_rcdb=true \
-Dwerror=true \
-Dinstall_examples=true \
-Dtest_data_file=$(pwd)/test_data.hipo \
-Dtest_num_events=${{ env.num_events }} \
-Dtest_output_dir=$(pwd)/validation_results \
-Dtest_num_threads=${{ env.num_threads }} \
meson setup iguana_build iguana_src \
--prefix=$GITHUB_WORKSPACE/iguana \
--pkg-config-path=$GITHUB_WORKSPACE/hipo/lib/pkgconfig \
-Drcdb:home=${{ steps.rcdb.outputs.prefix }} \
-Dz_require_rcdb=true \
-Dwerror=true \
-Dinstall_examples=true \
-Dtest_data_file=$GITHUB_WORKSPACE/test_data.hipo \
-Dtest_num_events=${{ env.num_events }} \
-Dtest_output_dir=$GITHUB_WORKSPACE/validation_results \
-Dtest_num_threads=${{ env.num_threads }} \
${{ matrix.opts }}
- name: dump all build options
run: meson configure iguana_build --no-pager
Expand Down Expand Up @@ -430,6 +430,14 @@ jobs:
meson test --benchmark --suite $suite -C iguana_build | tee benchmark_$suite.txt
done
iguana_src/.github/make-benchmark-table.rb benchmark_{single_threaded,memoize}.txt | xargs -0 -I{} echo {} >> $GITHUB_STEP_SUMMARY
### reproducible build test
- name: reproducible build test
if: ${{ matrix.id == 'cpp' }}
working-directory: iguana_src
run: |
meson reprotest -- \
--pkg-config-path=$GITHUB_WORKSPACE/hipo/lib/pkgconfig \
-Drcdb:home=${{ steps.rcdb.outputs.prefix }}
### coverage
- name: coverage
if: ${{ matrix.id == 'coverage' }}
Expand Down Expand Up @@ -492,14 +500,14 @@ jobs:
- name: consumer test meson
if: ${{ matrix.id == 'cpp' }}
run: |
meson setup build_consumer_meson iguana_src/examples/build_with_meson --prefix=$(pwd)/install_consumer_meson
meson setup build_consumer_meson iguana_src/examples/build_with_meson --prefix=$GITHUB_WORKSPACE/install_consumer_meson
meson install -C build_consumer_meson
echo "========================================= TEST RUN ========================================="
install_consumer_meson/bin/iguana_ex_cpp_00_run_functions test_data.hipo 10
- name: consumer test cmake
if: ${{ matrix.id == 'cpp' }}
run: |
cmake -B build_consumer_cmake -S iguana_src/examples/build_with_cmake -DCMAKE_PREFIX_PATH=$(pwd)/hipo -G Ninja --install-prefix=$(pwd)/install_consumer_cmake
cmake -B build_consumer_cmake -S iguana_src/examples/build_with_cmake -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/hipo -G Ninja --install-prefix=$GITHUB_WORKSPACE/install_consumer_cmake
cmake --build build_consumer_cmake
cmake --install build_consumer_cmake
echo "========================================= TEST RUN ========================================="
Expand Down

0 comments on commit 8c3d2b7

Please sign in to comment.