Skip to content

Commit e2d76a4

Browse files
committed
Add main GHA
1 parent 19805f2 commit e2d76a4

1 file changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: CI and Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: main
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build-linux:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: recursive
26+
fetch-depth: 0
27+
28+
- name: Cache vcpkg artifacts
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
vcpkg/downloads
33+
vcpkg/buildtrees
34+
vcpkg/packages
35+
build/Release/vcpkg_installed
36+
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-vcpkg-
39+
40+
- name: Install system dependencies
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install --no-install-recommends -y doxygen graphviz ninja-build
44+
45+
- name: Bootstrap vcpkg
46+
run: |
47+
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
48+
49+
- name: Configure CMake
50+
run: |
51+
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja
52+
53+
- name: Build Release targets
54+
run: |
55+
cmake --build build/Release
56+
57+
- name: Build documentation
58+
run: |
59+
cmake --build build/Release --target docs
60+
61+
- name: Upload documentation artifact
62+
uses: actions/upload-pages-artifact@v4
63+
with:
64+
path: build/Release/doc/docs/html
65+
66+
build-windows:
67+
runs-on: windows-latest
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v4
71+
with:
72+
submodules: recursive
73+
fetch-depth: 0
74+
75+
- name: Cache vcpkg artifacts
76+
uses: actions/cache@v4
77+
with:
78+
path: |
79+
vcpkg/downloads
80+
vcpkg/buildtrees
81+
vcpkg/packages
82+
build/Release/vcpkg_installed
83+
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
84+
restore-keys: |
85+
${{ runner.os }}-vcpkg-
86+
87+
- name: Bootstrap vcpkg
88+
shell: cmd
89+
run: |
90+
vcpkg\bootstrap-vcpkg.bat -disableMetrics
91+
92+
- name: Configure CMake
93+
shell: cmd
94+
run: |
95+
cmake -S . -B build -G "Visual Studio 17 2022"
96+
97+
- name: Build Release targets
98+
shell: cmd
99+
run: |
100+
cmake --build build --config Release
101+
102+
deploy-docs:
103+
runs-on: ubuntu-latest
104+
needs:
105+
- build-linux
106+
- build-windows
107+
environment:
108+
name: github-pages
109+
url: ${{ steps.deployment.outputs.page_url }}
110+
steps:
111+
- name: Deploy to GitHub Pages
112+
id: deployment
113+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)