-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (101 loc) · 3.05 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
clang-format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run clang-format
uses: jidicula/[email protected]
with:
clang-format-version: 18
build-and-test-cmake:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache CCache
uses: actions/cache@v4
id: ccache
with:
path: ~/.cache/ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('conanfile.py') }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('CMakePresets.json') }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-ccache-${{ hashFiles('conanfile.py') }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('CMakePresets.json') }}-
${{ runner.os }}-ccache-
- name: Setup Conan
uses: hankhsu1996/setup-conan@v1
with:
conan-version: "2.5.0"
cache-dependencies: true
cache-tool: true
- name: Install dependencies
run: |
conan profile detect --force
conan install . --build=missing
conan install . -s build_type=Debug --build=missing
- name: Configure CMake and build project
run: |
cmake --preset release
cmake --build --preset release
- name: Run tests
run: ctest --preset release
build-and-test-bazel:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Build with Bazel
run: |
bazel build //...
- name: Test with Bazel
run: |
bazel test //...
docs:
runs-on: ubuntu-latest
container: hankhsu1996/doxygen:1.11.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Generate Doxygen documentation
run: doxygen docs/Doxyfile
- name: Upload Doxygen documentation artifacts
uses: actions/upload-artifact@v4
with:
name: doxygen-docs
path: docs/generated/html
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Doxygen documentation artifacts
uses: actions/download-artifact@v4
with:
name: doxygen-docs
path: docs/generated/html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/generated/html
publish_branch: gh-pages