Skip to content

Build Third-party libraries on Linux (static) #40

Build Third-party libraries on Linux (static)

Build Third-party libraries on Linux (static) #40

# This workflow builds third-party libraries for Ocean on Linux (static)
# Based on : https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Build Third-party libraries on Linux (static)
on:
schedule:
# Execute this workflow:
# Mon-Sun, every 24 hours at 6 am (UTC)
- cron: '0 6 * * *'
# Have the ability to trigger this job manually through the API
workflow_dispatch:
env:
OCEAN_LINK_TYPE: static
OCEAN_THIRDPARTY_BUILD_PATH: ${{ github.workspace }}/ocean_thirdparty_build
OCEAN_THIRDPARTY_INSTALL_PATH: ${{ github.workspace }}/ocean_thirdparty_install
jobs:
build:
name: Linux (${{ matrix.build_config }}, static)
runs-on: ubuntu-latest
strategy:
matrix:
build_config: [debug, release]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y -o Acquire::Retries=5 \
git ninja-build zip libx11-dev libgtk-3-dev \
liblzma-dev libgl1-mesa-dev libxcb-glx0-dev \
libdeflate-dev libudev-dev zlib1g-dev
# - name: Install a newer CMake
# run: |
# sudo apt purge --auto-remove cmake
# wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
# sudo apt-add-repository -y 'deb https://apt.kitware.com/ubuntu/ jammy main'
# sudo apt update
# sudo apt install -y cmake
- name: Cache install artifacts
id: cache-thirdparty-install
uses: actions/cache@v4
with:
key: thirdparty-install-${{ matrix.build_config }}-${{ hashFiles('build/cmake/') }}
path: ${{ env.OCEAN_THIRDPARTY_INSTALL_PATH }}
- name: Build and install third-party libraries for Ocean
if: ${{ steps.cache-thirdparty-install.outputs.cahe-hit != 'true' }}
run: |
${{ github.workspace }}/build/cmake/build_thirdparty_linuxunix.sh \
-i ${{ env.OCEAN_THIRDPARTY_INSTALL_PATH }} \
-b ${{ env.OCEAN_THIRDPARTY_BUILD_PATH }} \
-c ${{ matrix.build_config }} \
-l ${{ env.OCEAN_LINK_TYPE }}