Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI workflow for C++ #3643

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/cpp-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow builds and unit tests both main C++ API and also build/data tools for metadata generation.

name: Testing C++ API
on: pull_request
permissions:
contents: read

jobs:
cpp-test:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0

- name: Set up C++ environment
run: |
sudo apt-get install \
cmake cmake-curses-gui libprotobuf-dev libgtest-dev libre2-dev \
libicu-dev libboost-dev libboost-thread-dev libboost-system-dev \
protobuf-compiler

- name: Build C++
run: |
cd cpp
mkdir build
cd build
cmake ..
make

- name: Test C++ Build Tools
run: |
./cpp/build/tools/generate_geocoding_data_test

- name: Test C++ API
run: |
./cpp/build/libphonenumber_test
Loading