-
Notifications
You must be signed in to change notification settings - Fork 6
145 lines (126 loc) · 3.96 KB
/
cpp.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: C++
# spell-checker:ignore awalsh,ctest,DCMAKE,doxyindexer,pkgs
on:
push:
paths:
- .github/workflows/cpp.yml
- bindings/cpp/**
- CMakeLists.txt
- crates/**
- "!crates/oxidd-cli/**"
- Cargo.*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint & Doc
runs-on: ubuntu-24.04
env:
doxygen_version: 1.11.0
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: cbindgen
version: 1.0
- uses: actions/cache@v4
id: cache-doxygen
with:
path: |
~/.local/bin/doxygen
~/.local/bin/doxyindexer
key: doxygen-linux-${{ env.doxygen_version }}
- name: Download doxygen
if: steps.cache-doxygen.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.local
curl https://www.doxygen.nl/files/doxygen-$doxygen_version.linux.bin.tar.gz | tar -xz -C ~/.local --strip-components=1 doxygen-$doxygen_version/bin/{doxygen,doxyindexer}
- name: Add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- name: Build Docs
working-directory: build
run: make oxidd-doc
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 18
ignore: "|!bindings/cpp"
database: "build/compile_commands.json"
style: "file" # Use .clang-format config file
tidy-checks: "" # Use .clang-tidy config file
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
step-summary: true
- name: Fail Fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1
- name: Deploy Docs
if: ${{ github.repository == 'OxiDD/oxidd' && github.ref == 'refs/heads/main' }}
working-directory: build/doc/html
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
ssh-agent sh -c "echo '$KEY' | ssh-add - && tar -cvz . | ssh -l '$USER' -p '$PORT' '$HOST' /extract-api.sh cpp dev"
env:
HOST: ${{ secrets.WEBSITE_SSH_HOST }}
USER: ${{ secrets.WEBSITE_SSH_USER }}
PORT: ${{ secrets.WEBSITE_SSH_PORT }}
KEY: ${{ secrets.WEBSITE_SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.WEBSITE_SSH_KNOWN_HOSTS }}
test-linux:
name: Test (Linux)
runs-on: ubuntu-24.04
strategy:
matrix:
compiler:
- { cc: "gcc", cxx: "g++" }
- { cc: "clang", cxx: "clang++" }
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: cbindgen
version: 1.0
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
- name: Build
working-directory: build
run: make boolean-function
- name: Run Tests
working-directory: build
run: make test
test-mac:
name: Test (macOS)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install cbindgen
run: brew install cbindgen
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug
- name: Build
working-directory: build
run: make boolean-function
- name: Run Tests
working-directory: build
run: make test
test-win:
name: Test (Windows)
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: CMake Configure
run: cmake -B build
- name: Build
run: cmake --build build --target bindings/cpp/tests/boolean-function
- name: Run Tests
working-directory: build
run: ctest -C Debug