-
Notifications
You must be signed in to change notification settings - Fork 24
107 lines (90 loc) · 3.52 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: "ci"
on:
workflow_dispatch:
release:
types:
- created
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-13] # macos-12 is deprecated https://github.com/actions/runner-images/issues/10721
fail-fast: false # see https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#handling-failures
env:
BUILD_TYPE: Release # possible options: MinSizeRel Release, Debug, RelWithDebInfo
BUILD_PATH: cmake-build
INSTALL_PATH: out
steps:
- name: Install dependencies (Linux)
if: runner.os == 'Linux' # see https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
run: sudo apt-get update && sudo apt-get install libegl1-mesa-dev libdbus-1-dev libgtk-3-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS' # see https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
run: brew install mesalib-glw
- name: Git Checkout
uses: actions/checkout@v4
- name: Cache Submodules
id: cache-submodules
uses: actions/cache@v4
with:
path: libs
key: cache-submodules-${{ hashFiles( '.gitmodules' ) }}
restore-keys: cache-submodules-
- name: Git Checkout Submodules
if: steps.cache-submodules.outputs.cache-hit == 'false'
run: |
git submodule init
git submodule update
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{env.BUILD_PATH}}
- name: Configure CMake
shell: bash
working-directory: ${{env.BUILD_PATH}}
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGITHUB_REF_NAME=${{github.ref_name}} -DGITHUB_SHA=${{github.sha}}
- name: Build
working-directory: ${{env.BUILD_PATH}}
shell: bash
run: cmake --build . --config ${{env.BUILD_TYPE}} --target install
- name: CTest
working-directory: ${{env.BUILD_PATH}}
shell: bash
run: ctest -C ${{env.BUILD_TYPE}} --verbose --output-on-failure
- name: CPack
working-directory: ${{env.BUILD_PATH}}
shell: bash
run: cpack -C ${{env.BUILD_TYPE}}
- name: Binary Artifact
uses: actions/upload-artifact@v4
with:
name: nodable-${{ runner.os }}
path: ${{env.INSTALL_PATH}}/app/*
- name: Package Artifact
uses: actions/upload-artifact@v4
with:
name: nodable-package-${{ runner.os }}
path: |
!${{env.INSTALL_PATH}}/package/_CPack_Packages
${{env.INSTALL_PATH}}/package/*.*
doxygen:
runs-on: [ubuntu-20.04]
needs: [build]
if: ${{ success() }} # see https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
steps:
- name: Git recursive checkout
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install doxygen
- name: Generate documentation
run: cd docs && doxygen
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: Nodable-Technical-Documentation
path: ${{runner.workspace}}/Nodable/docs/doxygen