Skip to content

Commit aef2fdc

Browse files
silvio2402mandlil
andauthored
Add CI workflow for C++ (#3643)
Co-authored-by: mandlil <138015259+mandlil@users.noreply.github.com>
1 parent 1c1bac9 commit aef2fdc

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow builds and unit tests both main C++ API and also build/data tools for metadata generation.
2+
3+
name: Testing C++ API
4+
on: pull_request
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
cpp-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Harden Runner
13+
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
14+
with:
15+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
16+
17+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
18+
19+
- name: Set up C++ environment
20+
run: |
21+
sudo apt-get install \
22+
cmake cmake-curses-gui libprotobuf-dev libgtest-dev libre2-dev \
23+
libicu-dev libboost-dev libboost-thread-dev libboost-system-dev \
24+
protobuf-compiler
25+
26+
- name: Build C++
27+
run: |
28+
cd cpp
29+
mkdir build
30+
cd build
31+
cmake ..
32+
make
33+
34+
- name: Test C++ Build Tools
35+
run: |
36+
./cpp/build/tools/generate_geocoding_data_test
37+
38+
- name: Test C++ API
39+
run: |
40+
./cpp/build/libphonenumber_test

0 commit comments

Comments
 (0)