Skip to content

Commit

Permalink
[TEST] Improved CI for Ogre
Browse files Browse the repository at this point in the history
  • Loading branch information
LAGNEAU Romain committed Jan 8, 2025
1 parent 42fc48d commit 21643ab
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-ogre-apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev

- name: Install Ogre 1.9
if: matrix.ogre == 'ogre-1.9'
if: matrix.ogre == 'ogre-1.9' && matrix.standard != '17'
run: sudo apt-get update && sudo apt-get install -y libogre-1.9-dev

- name: Install Ogre 1.12
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/ubuntu-ogre-src.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Ubuntu-ogre-src

# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
pull_request:
types: [opened, reopened, synchronize]
schedule:
- cron: '0 2 * * SUN'

# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

env:
# Function to get the most recent tag of a remote repository without having to clone it, excluding tag with 'pr' as in Pre Release
FUNCTION_GET_LATEST: 'git -c "versionsort.suffix=-" ls-remote --exit-code --refs --sort="version:refname" --tags ${GIT_ADDRESS} "*.*.*" | cut --delimiter="/" --fields=3 | grep -v -e pr | tail --lines=1'

jobs:
build-ubuntu-ogre-src:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Print system information
run: lscpu

- name: Print OS information
run: lsb_release -a

- name: Install dependencies for ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update && sudo apt-get install -y libdc1394-22-dev
- name: Install common dependencies for ubuntu
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libv4l-dev gfortran liblapack-dev libeigen3-dev
sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install -y mesa-common-dev mesa-utils freeglut3-dev libflann-dev libboost-all-dev
sudo apt-get install -y nlohmann-json3-dev
- name: Install dependencies for ubuntu-latest
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libeigen3-dev
sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
- name: Install Ogre dependencies
run: |
sudo apt-get update && sudo apt-get install -y libgles2-mesa-dev libvulkan-dev glslang-dev libxrandr-dev libxaw7-dev libx11-dev libzzip-dev libsdl2-dev
- name: Build Ogre from source
run: |
pwd
GIT_ADDRESS="https://github.com/OGRECave/ogre"
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
echo "Newest tag is ${LATEST_TAG}"
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${HOME}/ogre
cd ${HOME}/ogre
mkdir build && cd build && mkdir install
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j$(nproc) install
echo "OGRE_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $OGRE_DIR
- name: Clone visp-images
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/
run: |
git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV
echo ${VISP_INPUT_IMAGE_PATH}
- name: Configure CMake
run: |
pwd
mkdir build && cd build && mkdir install
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/install
cat ViSP-third-party.txt
- name: Build visp-config script
working-directory: build
run: |
make -j$(nproc) developer_scripts
./bin/visp-config --cflags
./bin/visp-config --libs
- name: Build and install ViSP
working-directory: build
run: |
make -j$(nproc) install
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VISP_DIR
- name: Run unit tests
working-directory: build
run: ctest -j$(nproc) --output-on-failure

- name: Clone visp_started
run: |
git clone --depth 1 https://github.com/lagadic/visp_started ${HOME}/visp_started
- name: Build visp_started with ViSP as 3rdparty
run: |
cd ${HOME}/visp_started
mkdir visp_started-build
cd visp_started-build
cmake ..
make -j$(nproc)

0 comments on commit 21643ab

Please sign in to comment.