Skip to content

Commit

Permalink
ci: combine test jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Dec 24, 2023
1 parent 35f774a commit d486fd4
Showing 1 changed file with 26 additions and 43 deletions.
69 changes: 26 additions & 43 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ jobs:
matrix:
binding: [ cpp, python ]
include:
- { binding: cpp, opts: '' }
- { binding: python, opts: '--python' }
- { binding: cpp, configure_opts: '' }
- { binding: python, configure_opts: '--python' }
steps:
- uses: actions/checkout@v4
with: # settings needed for version number detection
Expand All @@ -111,7 +111,7 @@ jobs:
run: ls *.tar.gz | xargs -I{} tar xzvf {}
- run: tree
- name: configure
run: ./configure.py --hipo hipo --fmt fmt --examples --no-documentation ${{ matrix.opts }}
run: ./configure.py --hipo hipo --fmt fmt --examples --no-documentation ${{ matrix.configure_opts }}
- name: build
run: ./install-iguana.sh
- name: dump build log
Expand Down Expand Up @@ -143,13 +143,15 @@ jobs:
steps:
- name: download
run: wget --no-check-certificate http://clasweb.jlab.org/clas12offline/distribution/clas12-timeline/validation_files.tar.gz
- name: list
run: tar tzvf 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: validation_files.tar.gz
path: test_data.hipo

# run tests
#########################################################
Expand All @@ -160,15 +162,25 @@ jobs:
- download_validation_files
- build_iguana
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
binding: [ cpp, python ]
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 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_cpp
name: build_iguana_${{ matrix.binding }}
- name: get test data
uses: actions/download-artifact@v3
with:
Expand All @@ -179,46 +191,18 @@ jobs:
rm -v *.tar.gz
- name: tree artifacts
run: tree
- name: run test
- name: test cpp
if: ${{ matrix.binding == 'cpp' }}
run: |
test_file=$(find validation_files -name "*.hipo" | head -n1)
echo "[+] TEST FILE: $test_file"
for exe in $(find iguana/bin -executable -type f); do
echo "[+] EXECUTE TEST: $exe"
$exe $test_file
$exe test_data.hipo 10
done
test_bind_python:
name: Test Python Bindings
needs:
- download_validation_files
- build_iguana
runs-on: ubuntu-latest
steps:
- 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_python
- 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: pip install requirements
run: python -m pip install -r bind/python/requirements.txt
- name: run test
- name: test python
if: ${{ matrix.binding == 'python' }}
run: |
test_file=$(find validation_files -name "*.hipo" | head -n1)
echo "[+] TEST FILE: $test_file"
source iguana/bin/this_iguana.sh
iguana/bin/iguana-example-bind.py ${test_file} 1
iguana/bin/iguana-example-bind.py test_data.hipo 10
test_dependent_builds:
name: Test Dependent Builds
Expand Down Expand Up @@ -252,13 +236,12 @@ jobs:
rm -v *.tar.gz
- name: build and run
run: |
test_file=$(find validation_files -name "*.hipo" | head -n1)
source iguana/bin/this_iguana.sh
echo "CI VARS: ------------------"
echo "PKG_CONFIG_PATH = $PKG_CONFIG_PATH"
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo "PYTHONPATH = $PYTHONPATH"
.github/test-dependent-build.sh ${{ matrix.tool }} $test_file 1
.github/test-dependent-build.sh ${{ matrix.tool }} test_data.hipo 1
# documentation
#########################################################
Expand Down

0 comments on commit d486fd4

Please sign in to comment.