Skip to content

Commit

Permalink
ci: organize steps with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jan 13, 2024
1 parent 077080f commit c2866bd
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ jobs:
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=hipo -DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake --build build -j2
cmake --install build
tar czvf hipo{.tar.gz,}
- run: brew install tree
if: ${{ inputs.runner == 'macos-latest' }}
- run: tree hipo
- name: tar
run: tar czvf hipo{.tar.gz,}
- uses: actions/upload-artifact@v3
with:
name: build_deps
Expand All @@ -50,22 +49,24 @@ jobs:
build_fmt:
name: Build fmt
runs-on: ${{ inputs.runner }}
if: ${{ inputs.runner != 'macos-latest' }} # prefer Homebrew fmt installation on macOS
steps:
- name: checkout fmt
if: ${{ inputs.runner != 'macos-latest' }} # prefer Homebrew fmt installation on macOS (needed on every step, since we just want this job to succeed on macOS)
uses: actions/checkout@v4
with:
repository: fmtlib/fmt
ref: ${{ env.fmt_version }}
- name: build
if: ${{ inputs.runner != 'macos-latest' }}
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=fmt -DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake --build build -j2
cmake --install build
tar czvf fmt{.tar.gz,}
- run: tree fmt
- name: tar
run: tar czvf fmt{.tar.gz,}
if: ${{ inputs.runner != 'macos-latest' }}
- uses: actions/upload-artifact@v3
if: ${{ inputs.runner != 'macos-latest' }}
with:
name: build_deps
retention-days: 1
Expand All @@ -88,13 +89,23 @@ jobs:
- { binding: cpp, configure_opts: '' }
- { binding: python, configure_opts: '--python' }
steps:
### setup
- 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
### dependencies
- name: get dependency build artifacts
uses: actions/download-artifact@v3
with:
name: build_deps
- run: brew install fmt
if: ${{ inputs.runner == 'macos-latest' }}
- name: untar build
run: ls *.tar.gz | xargs -I{} tar xzvf {}
- name: summarize dependencies
run: |
echo '### Dependencies' >> $GITHUB_STEP_SUMMARY
Expand All @@ -103,23 +114,22 @@ jobs:
for dep in python meson ninja ; do
echo "| \`$dep\` | $($dep --version) |" >> $GITHUB_STEP_SUMMARY
done
echo "| \`fmt\` | ${{ env.fmt_version }} |" >> $GITHUB_STEP_SUMMARY ### FIXME: differs from Homebrew
if [ "${{ inputs.runner }}" = "macos-latest" ]; then
echo "| \`fmt\` | $(brew info fmt | head -n1) |" >> $GITHUB_STEP_SUMMARY
else
echo "| \`fmt\` | ${{ env.fmt_version }} |" >> $GITHUB_STEP_SUMMARY
fi
echo "| \`hipo\` | ${{ env.hipo_version }} |" >> $GITHUB_STEP_SUMMARY
- name: get dependency build artifacts
uses: actions/download-artifact@v3
with:
name: build_deps
- run: brew install fmt
if: ${{ inputs.runner == 'macos-latest' }}
- name: untar build
run: ls *.tar.gz | xargs -I{} tar xzvf {}
### tree
- run: brew install tree
if: ${{ inputs.runner == 'macos-latest' }}
- run: tree
### build iguana
- name: configure
run: ./configure.py --hipo hipo --fmt fmt --examples --no-documentation ${{ matrix.configure_opts }}
- name: build
run: ./install-iguana.sh
### dump info about this build
- name: dump build log
if: always()
run: cat build-iguana/meson-logs/meson-log.txt
Expand All @@ -144,6 +154,7 @@ jobs:
cat $pcfile
done
- run: tree iguana
### upload artifacts
- name: tar
run: tar czvf iguana{.tar.gz,}
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -188,6 +199,7 @@ jobs:
- { binding: cpp, extension: '' }
- { binding: python, extension: '.py' }
steps:
### setup
- uses: actions/checkout@v4
with:
path: iguana_src # keep source code isolated
Expand All @@ -198,6 +210,7 @@ jobs:
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
python -m pip install -r iguana_src/bind/python/requirements.txt
### dependencies and test data
- name: get dependency build artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -216,10 +229,12 @@ jobs:
run: |
ls *.tar.gz | xargs -I{} tar xzvf {}
rm -v *.tar.gz
### tree
- run: brew install tree
if: ${{ inputs.runner == 'macos-latest' }}
- name: tree artifacts
run: tree
### set env vars
- name: source environment for Linux and python
if: ${{ inputs.runner == 'ubuntu-latest' && matrix.binding == 'python' }}
run: |
Expand All @@ -233,6 +248,7 @@ jobs:
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH >> $GITHUB_ENV
echo PYTHONPATH=$PYTHONPATH >> $GITHUB_ENV
echo DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH >> $GITHUB_ENV # for cppyy on macOS
### run tests
- name: test 00
run: iguana/bin/iguana-example-00-basic${{ matrix.extension }} test_data.hipo ${{ env.num_events }}
- name: test 01
Expand All @@ -249,7 +265,12 @@ jobs:
matrix:
tool: [ cmake, make, meson ]
steps:
### setup
- uses: actions/checkout@v4
- name: setup meson
if: ${{ matrix.tool == 'meson' }}
run: python -m pip install meson ninja
### dependencies and test data
- name: get dependency build artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -268,12 +289,11 @@ jobs:
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
### set env vars
- name: set cmake prefix path
if: ${{ matrix.tool == 'cmake' }}
run: echo CMAKE_PREFIX_PATH=$(pwd)/hipo >> $GITHUB_ENV
### build test
- name: build
run: |
source iguana/bin/this_iguana.sh
Expand All @@ -285,6 +305,7 @@ jobs:
else
readelf -d install-consumer/bin/iguana-example-00-basic
fi
### run test
- name: run
run: |
install-consumer/bin/iguana-example-00-basic test_data.hipo 1
Expand Down

0 comments on commit c2866bd

Please sign in to comment.