JetReconstruction.jl locally tested #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| jobs: | |
| docs: | |
| name: Build and Deploy Documentation | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| statuses: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Needed for version detection | |
| - name: Setup Julia environment | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1' | |
| - name: Cache Julia packages | |
| uses: julia-actions/cache@v2 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| pkg-config \ | |
| libhepmc3-dev \ | |
| python3-dev \ | |
| libclang-dev \ | |
| clang | |
| - name: Setup Julia project and install dependencies | |
| run: | | |
| julia --project=. -e " | |
| using Pkg | |
| Pkg.instantiate() | |
| # Install additional required packages for building | |
| Pkg.add([\"CxxWrap\", \"WrapIt\"]) | |
| using CxxWrap | |
| using WrapIt | |
| WrapIt.install() | |
| " | |
| - name: Find and install WrapIt executable | |
| run: | | |
| JULIA_DEPOT=$(julia -e "println(first(DEPOT_PATH))") | |
| WRAPIT_PATH=$(find $JULIA_DEPOT -name "wrapit*" -type f -executable 2>/dev/null | head -1) | |
| if [ -n "$WRAPIT_PATH" ] && [ -f "$WRAPIT_PATH" ]; then | |
| sudo cp "$WRAPIT_PATH" /usr/bin/wrapit | |
| sudo chmod +x /usr/bin/wrapit | |
| fi | |
| - name: Build package bindings | |
| run: | | |
| cd gen | |
| rm -rf build/ cpp/jlHepMC3.* jl/ | |
| JULIA_DEPOT=$(julia -e "println(first(DEPOT_PATH))") | |
| LIBCLANG_DIR=$(find $JULIA_DEPOT -name "libclang*.so*" 2>/dev/null | head -1 | xargs dirname) | |
| LD_LIBRARY_PATH="$LIBCLANG_DIR:$LD_LIBRARY_PATH" julia --project=.. build.jl | |
| # Apply manual wrapper patches | |
| sed -i '/#include "HepMC3\/Units.h"/a #include "HepMC3Wrap.h"' gen/cpp/jlHepMC3.cxx | |
| sed -i '/for(const auto& w: wrappers) w->add_methods();/a \ add_manual_hepmc3_methods(jlModule);' gen/cpp/jlHepMC3.cxx | |
| cd build | |
| cmake --build . --config Release --parallel 8 | |
| - name: Build package | |
| uses: julia-actions/julia-buildpkg@v1 | |
| - name: Deploy documentation | |
| uses: julia-actions/julia-docdeploy@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} | |