From d486fd45b5d9b8842abecfc07c07d71c611cd7d7 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Sun, 24 Dec 2023 17:03:28 -0500 Subject: [PATCH] ci: combine test jobs --- .github/workflows/linux.yml | 69 ++++++++++++++----------------------- 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fa8b87af..50f8facb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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 @@ -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 @@ -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 ######################################################### @@ -160,7 +162,17 @@ 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: @@ -168,7 +180,7 @@ jobs: - 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: @@ -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 @@ -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 #########################################################