doc: recommend latest dependency tag rather than main branch #325
Workflow file for this run
This file contains 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: Linux | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
tags: [ '*' ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
hipo_version: dev | |
fmt_version: 9.1.0 | |
num_events: 10 | |
jobs: | |
# dependencies | |
######################################################### | |
build_hipo: | |
name: Build HIPO | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout hipo | |
uses: actions/checkout@v4 | |
with: | |
repository: c-dilks/hipo # FIXME: revert to gavalian | |
ref: ${{ env.hipo_version }} | |
- name: build | |
run: | | |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=hipo -DCMAKE_POSITION_INDEPENDENT_CODE=ON | |
cmake --build build -j2 | |
cmake --install build | |
- run: tree hipo | |
- name: tar | |
run: tar czvf hipo{.tar.gz,} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build_deps | |
retention-days: 1 | |
path: hipo.tar.gz | |
build_fmt: | |
name: Build fmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout fmt | |
uses: actions/checkout@v4 | |
with: | |
repository: fmtlib/fmt | |
ref: ${{ env.fmt_version }} | |
- name: build | |
run: | | |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=fmt -DCMAKE_POSITION_INDEPENDENT_CODE=ON | |
cmake --build build -j2 | |
cmake --install build | |
- run: tree fmt | |
- name: tar | |
run: tar czvf fmt{.tar.gz,} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build_deps | |
retention-days: 1 | |
path: fmt.tar.gz | |
# build | |
######################################################### | |
build_iguana: | |
name: Build Iguana | |
needs: | |
- build_hipo | |
- build_fmt | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
binding: [ cpp, python ] | |
include: | |
- { binding: cpp, configure_opts: '' } | |
- { binding: python, configure_opts: '--python' } | |
steps: | |
- uses: actions/checkout@v4 | |
with: # settings needed for version number detection | |
clean: false | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: setup meson | |
run: python -m pip install meson ninja | |
- name: summarize dependencies | |
run: | | |
echo '### Dependencies' >> $GITHUB_STEP_SUMMARY | |
echo '| Dependency | Version |' >> $GITHUB_STEP_SUMMARY | |
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY | |
for dep in python meson ninja ; do | |
echo "| \`$dep\` | $($dep --version) |" >> $GITHUB_STEP_SUMMARY | |
done | |
echo "| \`fmt\` | ${{ env.fmt_version }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| \`hipo\` | ${{ env.hipo_version }} |" >> $GITHUB_STEP_SUMMARY | |
- name: get dependency build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_deps | |
- name: untar build | |
run: ls *.tar.gz | xargs -I{} tar xzvf {} | |
- run: tree | |
- name: configure | |
run: ./configure.py --hipo hipo --fmt fmt --examples --no-documentation ${{ matrix.configure_opts }} | |
- name: build | |
run: ./install-iguana.sh | |
- name: dump build log | |
if: always() | |
run: cat build-iguana/meson-logs/meson-log.txt | |
- name: readelf iguana | |
run: | | |
binaries=$(find iguana/bin -executable -type f -exec grep -IL . "{}" \;) | |
libraries=$(find iguana -name "*.so") | |
for obj in $binaries $libraries; do | |
echo "[+++] READELF $obj" | |
readelf -d $obj | |
done | |
- name: cat pkg-config pc files | |
run: | | |
pcfiles=$(find iguana -type f -name "*.pc") | |
for pcfile in $pcfiles; do | |
echo "[+++] cat $pcfile" | |
cat $pcfile | |
done | |
- run: tree iguana | |
- name: tar | |
run: tar czvf iguana{.tar.gz,} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build_iguana_${{ matrix.binding }} | |
retention-days: 1 | |
path: iguana.tar.gz | |
# download test data | |
######################################################### | |
download_validation_files: | |
name: Download validation files | |
runs-on: ubuntu-latest | |
steps: | |
- name: download | |
run: wget --no-check-certificate http://clasweb.jlab.org/clas12offline/distribution/clas12-timeline/validation_files.tar.gz | |
- name: untar | |
run: tar xzvf validation_files.tar.gz | |
- name: select one file | |
run: mv -v $(find validation_files -name "*.hipo" | head -n1) test_data.hipo | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: validation_files | |
retention-days: 1 | |
path: test_data.hipo | |
# run tests | |
######################################################### | |
test_iguana: | |
name: Test Iguana | |
needs: | |
- download_validation_files | |
- build_iguana | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
binding: [ cpp, python ] | |
include: | |
- { binding: cpp, extension: '' } | |
- { binding: python, extension: '.py' } | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: iguana_src # keep source code isolated | |
- name: install python binding runtime dependencies | |
if: ${{ matrix.binding == 'python' }} | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
python -m pip install -r iguana_src/bind/python/requirements.txt | |
- name: get dependency build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_deps | |
- name: get iguana build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_iguana_${{ matrix.binding }} | |
- name: get test data | |
uses: actions/download-artifact@v3 | |
with: | |
name: validation_files | |
- name: untar artifacts | |
run: | | |
ls *.tar.gz | xargs -I{} tar xzvf {} | |
rm -v *.tar.gz | |
- name: tree artifacts | |
run: tree | |
- name: source environment | |
if: ${{ matrix.binding != 'cpp' }} | |
run: | | |
source iguana/bin/this_iguana.sh | |
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH >> $GITHUB_ENV | |
echo PYTHONPATH=$PYTHONPATH >> $GITHUB_ENV | |
- name: test 00 | |
run: stdbuf -o0 iguana/bin/iguana-example-00-basic${{ matrix.extension }} test_data.hipo ${{ env.num_events }} | |
- name: test 01 | |
run: stdbuf -o0 iguana/bin/iguana-example-01-bank-rows${{ matrix.extension }} test_data.hipo ${{ env.num_events }} | |
test_consumer_builds: | |
name: Test consumer builds | |
needs: | |
- download_validation_files | |
- build_iguana | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
tool: [ cmake, make, meson ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: get dependency build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_deps | |
- name: get iguana build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_iguana_cpp | |
- name: get test data | |
uses: actions/download-artifact@v3 | |
with: | |
name: validation_files | |
- name: untar artifacts | |
run: | | |
ls *.tar.gz | xargs -I{} tar xzvf {} | |
rm -v *.tar.gz | |
- name: setup meson | |
if: ${{ matrix.tool == 'meson' }} | |
run: python -m pip install meson ninja | |
- name: set cmake prefix path | |
if: ${{ matrix.tool == 'cmake' }} | |
run: echo CMAKE_PREFIX_PATH=$(pwd)/hipo >> $GITHUB_ENV | |
- name: build and run | |
run: | | |
source iguana/bin/this_iguana.sh | |
.github/test-consumer-build.sh ${{ matrix.tool }} test_data.hipo 1 | |
# documentation | |
######################################################### | |
doc_generate: | |
name: Generate documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: doxygen | |
uses: mattnotmitt/doxygen-action@v1 | |
with: | |
doxyfile-path: doc/Doxyfile | |
- uses: actions/upload-pages-artifact@v2 | |
with: | |
retention-days: 1 | |
path: doc/api/ | |
doc_deploy: | |
if: ${{ github.head_ref == 'main' || github.ref_name == 'main' }} | |
name: Deploy documentation | |
needs: doc_generate | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: deployment | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
# finalize | |
######################################################### | |
final: | |
name: Final | |
needs: | |
- test_iguana | |
- test_consumer_builds | |
runs-on: ubuntu-latest | |
steps: | |
- run: exit 0 |