|
| 1 | +name: Ensure relocatable |
| 2 | + |
| 3 | +on: [push,pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + relocatable: |
| 7 | + name: Ensure relocatable |
| 8 | + runs-on: ubuntu-latest |
| 9 | + env: |
| 10 | + CCACHE_DIR: /github/home/.ccache # Enable ccache |
| 11 | + CMAKE_CXX_COMPILER_LAUNCHER: ccache |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + with: |
| 16 | + submodules: recursive |
| 17 | + |
| 18 | + - uses: actions/cache@v3 |
| 19 | + with: |
| 20 | + path: ${{ env.CCACHE_DIR }} |
| 21 | + key: reloc |
| 22 | + |
| 23 | + - name: prepare cache dir |
| 24 | + run: sudo mkdir -p ${CCACHE_DIR}/tmp && sudo chown -R $(id -un) ${CCACHE_DIR} |
| 25 | + |
| 26 | + - name: prepare work prefix |
| 27 | + run: sudo mkdir -p /RELOC/SRC && sudo chown -R $(id -un) /RELOC |
| 28 | + |
| 29 | + - name: clone in /RELOC/SRC |
| 30 | + run: git -C /RELOC/SRC clone --recursive $(pwd) |
| 31 | + |
| 32 | + - name: install dependencies |
| 33 | + run: sudo apt install libboost-all-dev libeigen3-dev python-is-python3 python3-numpy python3-pip ccache |
| 34 | + |
| 35 | + - name: update CMake |
| 36 | + run: pip install -U pip && pip install -U cmake |
| 37 | + |
| 38 | + - name: configure in /RELOC/BLD |
| 39 | + run: cmake -S /RELOC/SRC/eigenpy -B /RELOC/BLD -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/RELOC/PFX |
| 40 | + |
| 41 | + - name: build in /RELOC/BLD |
| 42 | + run: cmake --build /RELOC/BLD -j2 |
| 43 | + |
| 44 | + - name: install in /RELOC/PFX |
| 45 | + run: cmake --build /RELOC/BLD -t install |
| 46 | + |
| 47 | + - name: check installed package doesn't contain references to RELOC |
| 48 | + run: grep -r RELOC /RELOC/PFX | grep -v Binary | tee references |
| 49 | + |
| 50 | + - name: exit accordingly |
| 51 | + run: exit $(wc -l references | cut -d " " -f 1) |
0 commit comments