| # 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@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 |
| with: |
| egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| |
| - 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 |