Skip to content

Commit

Permalink
Merge pull request #59 from c-dilks/fix-meson
Browse files Browse the repository at this point in the history
fix: finish `meson` porting and remove Makefiles and CMake files
  • Loading branch information
gavalian authored Sep 9, 2024
2 parents 1fc0823 + 399c512 commit 2009487
Show file tree
Hide file tree
Showing 40 changed files with 458 additions and 852 deletions.
20 changes: 20 additions & 0 deletions .github/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

[ $# -ne 1 ] && exit 1
runner=$1

case "$runner" in
'ubuntu-latest')
python -m pip install meson ninja
;;
'macos-latest')
brew install meson ninja tree
# install fortran compiler:
brew install gcc
brew unlink gcc
brew link gcc
;;
*)
exit 1
;;
esac
88 changes: 37 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,37 @@ defaults:

jobs:

build_cmake:
name: CMake build
build:
name: Build
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: build
- name: install dependencies
run: .github/install-dependencies.sh ${{ matrix.runner }}
- name: meson setup
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j4
cmake --install build
- run: brew install tree
if: ${{ matrix.runner == 'macos-latest' }}
meson setup build . \
--prefix=`pwd`/install \
-D install_examples=true \
-D test_file=`pwd`/test_data.hipo \
-D test_fortran=true
- run: meson install
working-directory: build
- name: dump build log
if: always()
run: cat build/meson-logs/meson-log.txt
- run: tree install

build_make:
name: Makefile build
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
with:
path: hipo_src
submodules: recursive # FIXME: need `lz4` submoudle for Makefile, whereas `cmake` does not
- name: build
working-directory: hipo_src
run: |
make -j4
make -j4 -C examples
- run: brew install tree
if: ${{ matrix.runner == 'macos-latest' }}
- run: tree hipo_src
- name: tar
run: tar cavf hipo_src{.tar.zst,}
run: tar cavf build{.tar.zst,}
- uses: actions/upload-artifact@v4
with:
name: build_make_${{ matrix.runner }}
name: build-${{ matrix.runner }}
retention-days: 5
path: hipo_src.tar.zst
path: build.tar.zst

download_test_data:
name: Download test data
Expand All @@ -82,35 +68,35 @@ jobs:
tar xvf validation_files_${{ env.type }}.tar.zst
mv -v $(find validation_files -type f -name "*.hipo" | head -n1) test_data.hipo
examples:
name: Run examples
needs: [ download_test_data, build_make ]
test:
name: Test
needs: [ download_test_data, build ]
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/download-artifact@v4
- uses: actions/checkout@v4
- name: install dependencies
run: .github/install-dependencies.sh ${{ matrix.runner }}
- name: download build
uses: actions/download-artifact@v4
with:
name: build_make_${{ matrix.runner }}
name: build-${{ matrix.runner }}
- name: untar artifacts
run: |
ls *.tar.zst | xargs -I{} tar xvf {}
rm *.tar.zst
mv -v hipo_src/* ./
rm -rf hipo_src
run: ls *.tar.zst | xargs -I{} tar xvf {}
- name: get test data
uses: actions/cache/restore@v4
with:
key: test_data
path: test_data.hipo
- run: examples/writeFile.exe
- run: examples/readFile.exe example_output.hipo
- run: examples/readFileTags.exe
- run: examples/showFile.exe example_output.hipo event::particle
- run: examples/readJson.exe test_data.hipo
- run: examples/tupleFile.exe
- run: examples/writeUserHeader.exe
- run: examples/bankRowList.exe test_data.hipo
- run: examples/histograms.exe test_data.hipo
- run: meson test
working-directory: build
- name: upload test logs
uses: actions/upload-artifact@v4
if: always()
with:
name: test-${{ matrix.runner }}
retention-days: 5
path: build/meson-logs/*
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
lib
slib
__pycache__
build
/build*/
/install*/
/.cache
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

194 changes: 0 additions & 194 deletions CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 2009487

Please sign in to comment.