Skip to content

Build Ocean on Linux (static) #3

Build Ocean on Linux (static)

Build Ocean on Linux (static) #3

# This workflow builds Ocean on Linux (static)
# Based on : https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Build Ocean on Linux (static)
on:
workflow_run:
workflows: ["Build Third-party libraries on Linux (static)"]
branches: [main]
types:
- completed
env:
OCEAN_LINK_TYPE: static
OCEAN_THIRDPARTY_INSTALL_PATH: ${{ github.workspace }}/ocean_thirdparty_install
OCEAN_BUILD_PATH: ${{ github.workspace }}/ocean_build
OCEAN_INSTALL_PATH: ${{ github.workspace }}/ocean_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: Download third-party artifacts
id: download-thirdparty-install
uses: dawidd6/action-download-artifact@v6
with:
name: thirdparty-install-${{ matrix.build_config }}
path: thirdparty-install-${{ matrix.build_config }}.tar.gz
run_id: ${{ github.event.workflow_run.id }}
skip_unpack: true
- name: Unzip third-party artifacts
run: |
tar -xvzf thirdparty-install-${{ matrix.build_config }}.tar.gz -C /
shell: bash
- name: Build and install Ocean
run: |
${{ github.workspace }}/build/cmake/build_ocean_linuxunix.sh \
-i ${{ env.OCEAN_INSTALL_PATH }} \
-b ${{ env.OCEAN_BUILD_PATH }} \
-c ${{ matrix.build_config }} \
-l ${{ env.OCEAN_LINK_TYPE }} \
-t ${{ env.OCEAN_THIRDPARTY_INSTALL_PATH }}
- name: Archive ocean install artifacts
run: |
tar -cvzf ocean-install-${{ matrix.build_config }}.tar.gz ${{ env.OCEAN_INSTALL_PATH }}
- name: Upload install archive
uses: actions/upload-artifact@v4
with:
name: ocean-install-${{ matrix.build_config }}
path: ./ocean-install-${{ matrix.build_config }}.tar.gz
compression-level: 0