-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (154 loc) · 5.75 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: ci
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- main
- develop
env:
CLANG_TIDY_VERSION: "10.0.1"
PYTHON_VERSION: "3.7"
GAFFER_ROOT: "/opt/gaffer-1.3.1.0"
FFMPEG_ROOT: "/opt/ffmpeg-5.1"
VERBOSE: 1
jobs:
Test:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: read
container:
image: ghcr.io/ilpvfx/ilp_gaffer_movie:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
# Recommendations:
# * support at least 2 operating systems
# * support at least 2 compilers
# * make sure all supported configurations for your project are built
#
# Disable/enable builds in this list to meet the above recommendations
# and your own projects needs.
matrix:
compiler:
# These are the installed compilers in the container image specified above.
- gcc-9.3.1
- clang-10.0.1
generator:
- "Unix Makefiles"
# - "Ninja Multi-Config"
build_type:
- Release
- Debug
# packaging_maintainer_mode:
# - ON
# - OFF
# build_shared:
# - OFF
#include:
# Add appropriate variables for gcov version required. This will intentionally break
# if you try to use a compiler that does not have gcov set
# - compiler: gcc-11
# gcov_executable: gcov
# enable_ipo: On
# - compiler: llvm-15.0.2
# enable_ipo: Off
# gcov_executable: "llvm-cov gcov"
# Set up preferred package generators, for given build configurations
# - build_type: Release
# packaging_maintainer_mode: OFF
# package_generator: TBZ2
# This exists solely to make sure a non-multiconfig build works
# - os: ubuntu-20.04
# compiler: gcc-11
# generator: Unix Makefiles
# build_type: Debug
# gcov_executable: gcov
# packaging_maintainer_mode: On
# enable_ipo: Off
steps:
# - name: Check for llvm version mismatches
# if: ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }}
# uses: actions/github-script@v3
# with:
# script: |
# core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')
- name: Checkout repository
uses: actions/checkout@v3
# - name: Setup Cache
# uses: ./.github/actions/setup_cache
# with:
# compiler: ${{ matrix.compiler }}
# build_type: ${{ matrix.build_type }}
# packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
# generator: ${{ matrix.generator }}
- name: Project Name
uses: cardinalby/export-env-action@v2
with:
envFile: '.github/constants.env'
# - name: Setup Cpp
# uses: aminya/setup-cpp@v1
# with:
# # compiler: ${{ matrix.compiler }}
# # vcvarsall: ${{ contains(matrix.os, 'windows' )}}
# cmake: true
# ninja: false
# vcpkg: false
# ccache: false
# clangtidy: false # ${{ env.CLANG_TIDY_VERSION }}
# cppcheck: false
# gcovr: false
# opencppcoverage: false
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{ matrix.generator }}" \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \
-D${{ env.PROJECT_NAME }}_ENABLE_IPO=${{ matrix.enable_ipo }} \
-D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} \
-D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} \
-DPYTHON_VERSION:STRING=${{ env.PYTHON_VERSION }} \
-DGAFFER_ROOT:STRING=${{ env.GAFFER_ROOT }} \
-DFFMPEG_ROOT=${{ env.FFMPEG_ROOT }} \
-DGIT_SHA:STRING=${{ github.sha }}
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{ matrix.build_type }}
- name: Test
working-directory: ./build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
ctest -C ${{ matrix.build_type }}
# - name: Unix - Test and coverage
# # if: runner.os != 'Windows'
# working-directory: ./build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# # run: |
# # ctest -C ${{matrix.build_type}}
# # gcovr -j ${{env.nproc}} --delete --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
# run: |
# ctest -C ${{ matrix.build_type }}
# - name: CPack
# if: matrix.package_generator != ''
# working-directory: ./build
# run: |
# cpack -C ${{matrix.build_type}} -G ${{matrix.package_generator}}
# - name: Publish Tagged Release
# uses: softprops/action-gh-release@v1
# if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.package_generator != '' }}
# with:
# files: |
# build/*-*${{ matrix.build_type }}*-*.*
# - name: Publish to codecov
# uses: codecov/codecov-action@v2
# with:
# flags: ${{ runner.os }}
# name: ${{ runner.os }}-coverage
# files: ./build/coverage.xml