-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (69 loc) · 2.83 KB
/
main.yml
File metadata and controls
82 lines (69 loc) · 2.83 KB
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
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-24.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v6
- name: Install bazelisk
run: |
mkdir -p "${GITHUB_WORKSPACE}/bin/"
wget https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -O "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
- name: Install clang-16
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main"
sudo apt-get update
sudo apt-get install -y clang-16 libc++-16-dev libc++abi-16-dev
echo "/usr/lib/llvm-16/bin" >> $GITHUB_PATH
- name: Install cmake
run: |
sudo apt-get install -y cmake ninja-build
echo "/usr/bin/cmake" >> $GITHUB_PATH
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
with:
limit-access-to-actor: true
- name: Build (C++17)
run: |
"${GITHUB_WORKSPACE}/bin/bazel" build --config=clang //...
- name: Test (C++17)
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --config=clang //...
- name: Build (C++20)
run: |
"${GITHUB_WORKSPACE}/bin/bazel" build --config=clang --config=cpp20 //...
- name: Test (C++20)
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --config=clang --config=cpp20 //...
- name: Build (CMake)
run: |
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build
ctest --test-dir build --output-on-failure
- name: Build w/ Tests (CMake)
run: |
rm -rf build
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DPIXELMATCH_BUILD_TESTS=ON
cmake --build build
ctest --test-dir build --output-on-failure