From 7781ae23b1dc1d639356e7fd342fa385b6952d49 Mon Sep 17 00:00:00 2001 From: silviobraendle Date: Thu, 26 Sep 2024 09:51:17 +0000 Subject: [PATCH] Add CI workflow for C++ --- .github/workflows/cpp-unit-test.yml | 40 +++++++++++++++++++ .../{unit-test.yml => java-unit-test.yml} | 0 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/cpp-unit-test.yml rename .github/workflows/{unit-test.yml => java-unit-test.yml} (100%) diff --git a/.github/workflows/cpp-unit-test.yml b/.github/workflows/cpp-unit-test.yml new file mode 100644 index 0000000000..4e49dc1dbe --- /dev/null +++ b/.github/workflows/cpp-unit-test.yml @@ -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 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/java-unit-test.yml similarity index 100% rename from .github/workflows/unit-test.yml rename to .github/workflows/java-unit-test.yml