-
Notifications
You must be signed in to change notification settings - Fork 59
65 lines (55 loc) · 2.31 KB
/
build_ocean_linux_helper.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 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) [Helper]
on:
workflow_call
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: Restore third-party artifacts
id: restore-thirdparty-install
uses: actions/cache/restore@v4
with:
key: thirdparty-install-${{ matrix.build_config }}-${{ hashFiles('build/cmake/') }}
path: ${{ env.OCEAN_THIRDPARTY_INSTALL_PATH }}
- name: Cache build artifacts
id: cache-ocean-build
uses: actions/cache@v4
with:
key: ocean-build-${{ matrix.build_config }}-${{ github.sha }}
path: ${{ env.OCEAN_BUILD_PATH }}
- name: Build and install Ocean
if: ${{ steps.cache-ocean-build.outputs.cache-hit != 'true' }}
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 }}