| 1 |
name: ๐งช Test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
paths-ignore: |
| 6 |
- 'doc/**' |
| 7 |
- '*.md' |
| 8 |
branches: |
| 9 |
- master |
| 10 |
- release/** |
| 11 |
|
| 12 |
pull_request: |
| 13 |
paths-ignore: |
| 14 |
- 'doc/**' |
| 15 |
- '*.md' |
| 16 |
branches: |
| 17 |
- master |
| 18 |
- release/** |
| 19 |
|
| 20 |
concurrency: |
| 21 |
group: ${{ github.workflow }}-${{ github.ref_name }} |
| 22 |
cancel-in-progress: true |
| 23 |
|
| 24 |
jobs: |
| 25 |
|
| 26 |
|
| 27 |
ce |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
windows-build: |
| 34 |
name: ๐ช win64 build |
| 35 |
runs-on: windows-latest |
| 36 |
steps: |
| 37 |
- uses: actions/checkout@v6 |
| 38 |
- uses: ilammy/msvc-dev-cmd@v1 |
| 39 |
- name: Build using nmake |
| 40 |
run: | |
| 41 |
cmake -S . -B build -G "NMake Makefiles" -D BUILD_TESTING=OFF -D WITHOUT_OPENCV=1 -D WITHOUT_CAIRO=1 -D WITHOUT_GAVL=1 |
| 42 |
cmake --build build |
| 43 |
|
| 44 |
c-lint: |
| 45 |
name: ๐จ C lint |
| 46 |
runs-on: ubuntu-latest |
| 47 |
if: "!contains(github.event.pull_request.labels.*.name, 'skip-lint')" |
| 48 |
steps: |
| 49 |
- uses: actions/checkout@v6 |
| 50 |
- uses: reviewdog/action-cpplint@master |
| 51 |
env: |
| 52 |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 |
with: |
| 54 |
github_token: ${{ secrets.GITHUB_TOKEN }} |
| 55 |
reporter: github-pr-check |
| 56 |
targets: --recursive src |
| 57 |
level: warning |
| 58 |
flags: --linelength=120 |
| 59 |
filter: "-readability/braces\ |
| 60 |
,-readability/casting\ |
| 61 |
,-readability/todo\ |
| 62 |
,-whitespace/comma\ |
| 63 |
,-whitespace/braces\ |
| 64 |
,-whitespace/comments\ |
| 65 |
,-whitespace/indent\ |
| 66 |
,-whitespace/newline\ |
| 67 |
,-whitespace/operators\ |
| 68 |
,-whitespace/parens\ |
| 69 |
,-whitespace/tab\ |
| 70 |
,-whitespace/end_of_line\ |
| 71 |
,-whitespace/line_length\ |
| 72 |
,-whitespace/blank_line\ |
| 73 |
,-whitespace/semicolon\ |
| 74 |
,-build/include_subdir\ |
| 75 |
,-build/include_order\ |
| 76 |
,-build/header_guard\ |
| 77 |
" |
| 78 |
|
| 79 |
test-suite: |
| 80 |
name: ๐ฌ test (${{ matrix.compiler }}) |
| 81 |
needs: [c-lint] |
| 82 |
if: "!contains(github.event.pull_request.labels.*.name, 'skip-test')" |
| 83 |
strategy: |
| 84 |
matrix: |
| 85 |
include: |
| 86 |
- compiler: clang-14 |
| 87 |
cxx_compiler: clang++-14 |
| 88 |
fail-fast: false |
| 89 |
runs-on: ubuntu-latest |
| 90 |
steps: |
| 91 |
- uses: actions/checkout@v6 |
| 92 |
with: |
| 93 |
fetch-depth: 0 |
| 94 |
- uses: hendrikmuhs/[email protected] |
| 95 |
- name: Install APT packages |
| 96 |
run: | |
| 97 |
sudo apt-get update -qy |
| 98 |
sudo apt-get install --no-install-recommends -y \ |
| 99 |
"${{ matrix.compiler }}" \ |
| 100 |
cmake ninja-build libfreetype-dev libopencv-dev \ |
| 101 |
libcairo2-dev libgavl-dev libgl-dev libegl-dev |
| 102 |
- name: Detect new plugins |
| 103 |
id: detect |
| 104 |
if: github.event_name == 'pull_request' |
| 105 |
run: | |
| 106 |
.github/scripts/detect-new-plugins.sh \ |
| 107 |
"${{ github.event.pull_request.base.sha }}" \ |
| 108 |
"${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT" |
| 109 |
- name: Print CI mode |
| 110 |
run: | |
| 111 |
echo "mode=${{ steps.detect.outputs.mode || 'full' }}" |
| 112 |
echo "reason=${{ steps.detect.outputs.reason || 'push event uses the full suite' }}" |
| 113 |
- name: ${{ matrix.compiler }} initialize cmake build |
| 114 |
run: | |
| 115 |
mkdir -p build && cd build |
| 116 |
cmake -G "Ninja" \ |
| 117 |
-DCMAKE_C_COMPILER="${{ matrix.compiler }}" \ |
| 118 |
-DCMAKE_CXX_COMPILER="${{ matrix.cxx_compiler }}" \ |
| 119 |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ |
| 120 |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
| 121 |
.. |
| 122 |
- name: ${{ matrix.compiler }} run ninja build |
| 123 |
if: github.event_name != 'pull_request' || steps.detect.outputs.mode != 'targeted' |
| 124 |
run: | |
| 125 |
cd build && ninja |
| 126 |
- name: ${{ matrix.compiler }} build new plugins |
| 127 |
if: github.event_name == 'pull_request' && steps.detect.outputs.mode == 'targeted' |
| 128 |
run: | |
| 129 |
cd build |
| 130 |
cmake --build . --target ${{ steps.detect.outputs.targets }} |
| 131 |
- name: ${{ matrix.compiler }} analyze plugins |
| 132 |
if: github.event_name != 'pull_request' || steps.detect.outputs.mode != 'targeted' |
| 133 |
run: | |
| 134 |
ctest --test-dir build --output-on-failure --parallel 4 |
| 135 |
- name: ${{ matrix.compiler }} analyze new plugins |
| 136 |
if: github.event_name == 'pull_request' && steps.detect.outputs.mode == 'targeted' |
| 137 |
run: | |
| 138 |
for plugin in ${{ steps.detect.outputs.plugin_paths }}; do |
| 139 |
build/test/frei0r-run -d -p "$plugin" |
| 140 |
done |