|
1 | | -# Run the uPSP project build system and unit tests. |
2 | | -# Artifacts are installed into the runner's system Python 3 environment. |
| 1 | +# Run the uPSP C++ build system and unit tests. |
3 | 2 | # |
4 | 3 | # Notes: |
5 | 4 | # |
|
26 | 25 | # - On NAS HECC systems, we build the C/C++ code with dynamic linkage due |
27 | 26 | # to the available system dependencies. This is *not* a default |
28 | 27 | # target supported by vcpkg, but it has a lot of community interest and |
29 | | -# "unofficial" testing support. Ref: https://github.com/microsoft/vcpkg/issues/15006 |
30 | | -# We patch up some of the RPATH quirks using 'patchelf'. |
| 28 | +# "unofficial" testing support. |
31 | 29 | # |
32 | | -name: unit-tests |
| 30 | +name: C/C++ unit tests |
33 | 31 | on: |
34 | 32 | push: |
35 | 33 | workflow_dispatch: |
|
51 | 49 |
|
52 | 50 | steps: |
53 | 51 | - uses: actions/checkout@v3 |
| 52 | + with: |
| 53 | + fetch-depth: 0 |
54 | 54 | - uses: lukka/get-cmake@latest |
55 | 55 | - name: Install dependencies (Linux) |
56 | 56 | run: | |
@@ -82,33 +82,22 @@ jobs: |
82 | 82 | runVcpkgInstall: true |
83 | 83 | # Release 2023.04.15 |
84 | 84 | vcpkgGitCommitId: '501db0f17ef6df184fcdbfbe0f87cde2313b6ab1' |
85 | | - - name: Patch vcpkg library headers with patchelf |
86 | | - run: | |
87 | | - cd vcpkg |
88 | | - ${{ github.workspace }}/.github/workflows/vcpkg-fix-rpaths |
89 | | - cd .. |
90 | | - - uses: actions/setup-python@v4 |
91 | | - with: |
92 | | - python-version: ${{ matrix.python-version }} |
93 | | - cache: 'pip' |
94 | | - - name: Upgrade pip to v23+ |
95 | | - run: | |
96 | | - pip install --upgrade pip |
97 | | - pip --version |
98 | | - python --version |
99 | | - - name: Run build+install with pip |
| 85 | + - name: Run CMake build |
100 | 86 | run: | |
101 | | - SKBUILD_CONFIGURE_OPTIONS=\ |
102 | | - " -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"\ |
103 | | - " -DVCPKG_TARGET_TRIPLET=x64-linux-dynamic" pip install -v . |
| 87 | + mkdir build |
| 88 | + cd build |
| 89 | + cmake \ |
| 90 | + -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \ |
| 91 | + -DVCPKG_TARGET_TRIPLET="x64-linux-dynamic" \ |
| 92 | + -DUPSP_BUILD_TESTING=ON \ |
| 93 | + -DUPSP_BUILD_APPLICATIONS=ON \ |
| 94 | + -DUPSP_BUILD_PYBIND11=ON \ |
| 95 | + .. |
| 96 | + make -j |
104 | 97 | # - name: Setup upterm session |
105 | 98 | # uses: lhotari/action-upterm@v1 |
106 | 99 | - name: Run C/C++ unit tests |
107 | | - # TODO this should be made cross-platform. Currently works only for ubuntu-latest |
108 | | - # TODO fix RUNPATH of built executables to avoid use of LD_LIBRARY_PATH |
109 | 100 | run: | |
110 | | - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${{ env.VCPKG_INSTALLED_DIR }}/${{ env.VCPKG_DEFAULT_TRIPLET }}/lib" |
111 | | - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" |
112 | 101 | cd cpp/test |
113 | | - ../../_skbuild/linux-x86_64-3.9/cmake-build/run_tests |
| 102 | + ../../build/cpp/test/run_tests |
114 | 103 |
|
0 commit comments