-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 3.02 KB
/
ci.yml
File metadata and controls
114 lines (93 loc) · 3.02 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
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
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
hygiene:
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve change contract range
id: contract_range
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "range=${{ github.event.pull_request.base.sha }}...${{ github.sha }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
echo "range=${{ github.event.before }}..${{ github.sha }}" >> "$GITHUB_OUTPUT"
else
echo "range=HEAD^..HEAD" >> "$GITHUB_OUTPUT"
fi
- name: Run release hygiene checks
env:
FRAME_CHANGE_CONTRACT_RANGE: ${{ steps.contract_range.outputs.range }}
run: bash scripts/check-release-hygiene.sh
- name: Run change contract checks
env:
FRAME_CHANGE_CONTRACT_RANGE: ${{ steps.contract_range.outputs.range }}
run: bash scripts/check-change-contracts.sh
build-test:
runs-on: ubuntu-24.04
needs: hygiene
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
clang-format \
cmake \
doxygen \
g++ \
ninja-build \
pkg-config
- name: Configure
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=23
- name: Check formatting
run: cmake --build build --target format-check
- name: Build
run: cmake --build build
- name: Generate API docs
run: cmake --build build --target docs
- name: Run tests
run: ctest --test-dir build --output-on-failure
- name: Validate install tree
run: |
INSTALL_DIR="$(mktemp -d)"
cmake --install build --prefix "$INSTALL_DIR"
test -x "$INSTALL_DIR/bin/frame_cli"
- name: Validate CLI startup
run: ./build/frame_cli --help
- name: Upload GitHub Pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: build/docs/doxygen/html
deploy-docs:
runs-on: ubuntu-24.04
needs: build-test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
concurrency:
group: github-pages
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@v4