From 04bcf06fc683f343fc351202d4bceabb50d9b5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20M=C4=99drek?= Date: Sat, 6 Sep 2025 21:31:52 +0200 Subject: [PATCH] fix: clang-format workflow --- .github/workflows/lint-cpp-objc.yaml | 40 ++++++++++++++--------- .github/workflows/lint-js-typecheck.yaml | 1 + .github/workflows/test-cpp.yaml | 11 +++++++ .github/workflows/test-js.yaml | 1 + encoding-core/ReactNativeEncodingBase64.h | 1 + encoding-core/ReactNativeEncodingHex.h | 1 + 6 files changed, 40 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint-cpp-objc.yaml b/.github/workflows/lint-cpp-objc.yaml index 6691a8b..87e2503 100644 --- a/.github/workflows/lint-cpp-objc.yaml +++ b/.github/workflows/lint-cpp-objc.yaml @@ -21,29 +21,39 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: lint-cpp-objc: name: Lint cpp and objc - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout Repo uses: actions/checkout@v4 with: fetch-depth: 0 - # https://dev.to/mayankpareek/introducing-ci-pipeline-for-clang-format-checks-in-faker-cxx-35go - - name: Cache clang-format dependencies - uses: actions/cache@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - path: /tmp/apt-cache - key: clang-format-${{ runner.os }}-${{ hashFiles('**/apt-packages.txt') }} - restore-keys: | - clang-format-${{ runner.os }}- + cache: 'yarn' + node-version: 20 - - name: Install clang-format - run: | - if [ ! -f /tmp/apt-cache/clang-format-16 ]; then - sudo apt-get update - sudo apt-get install -y clang-format-16 - touch /tmp/apt-cache/clang-format-16 - fi + - name: Install dependencies + run: yarn install --immutable + shell: bash + + # https://dev.to/mayankpareek/introducing-ci-pipeline-for-clang-format-checks-in-faker-cxx-35go + # - name: Cache clang-format dependencies + # uses: actions/cache@v4 + # with: + # path: /tmp/apt-cache + # key: clang-format-${{ runner.os }}-${{ hashFiles('**/apt-packages.txt') }} + # restore-keys: | + # clang-format-${{ runner.os }}- + + # - name: Install clang-format + # run: | + # if [ ! -f /tmp/apt-cache/clang-format-16 ]; then + # sudo apt-get update + # sudo apt-get install -y clang-format-16 + # touch /tmp/apt-cache/clang-format-16 + # fi - name: Run clang-format run: | diff --git a/.github/workflows/lint-js-typecheck.yaml b/.github/workflows/lint-js-typecheck.yaml index 7cb1638..6180635 100644 --- a/.github/workflows/lint-js-typecheck.yaml +++ b/.github/workflows/lint-js-typecheck.yaml @@ -23,6 +23,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: lint-js-typecheck: name: JS lint and typecheck + runs-on: ubuntu-24.04 steps: - name: Checkout Repo uses: actions/checkout@v4 diff --git a/.github/workflows/test-cpp.yaml b/.github/workflows/test-cpp.yaml index a09c5b0..0e5793b 100644 --- a/.github/workflows/test-cpp.yaml +++ b/.github/workflows/test-cpp.yaml @@ -19,11 +19,22 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: test-cpp: name: Run GTest suite + runs-on: ubuntu-24.04 steps: - name: Checkout Repo uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: 'yarn' + node-version: 20 + + - name: Install dependencies + run: yarn install --immutable + shell: bash + - name: Run GTest run: yarn test:cpp:prepare diff --git a/.github/workflows/test-js.yaml b/.github/workflows/test-js.yaml index ce933cb..338d399 100644 --- a/.github/workflows/test-js.yaml +++ b/.github/workflows/test-js.yaml @@ -17,6 +17,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: test-js: name: Run Jest suite + runs-on: ubuntu-24.04 steps: - name: Checkout Repo uses: actions/checkout@v4 diff --git a/encoding-core/ReactNativeEncodingBase64.h b/encoding-core/ReactNativeEncodingBase64.h index 3611fd3..52b0e13 100644 --- a/encoding-core/ReactNativeEncodingBase64.h +++ b/encoding-core/ReactNativeEncodingBase64.h @@ -1,5 +1,6 @@ #pragma once +#include #include std::string decodeFromBase64BufferToUtf8String(const uint8_t *data, size_t size); diff --git a/encoding-core/ReactNativeEncodingHex.h b/encoding-core/ReactNativeEncodingHex.h index 28b2df7..b2bd1bb 100644 --- a/encoding-core/ReactNativeEncodingHex.h +++ b/encoding-core/ReactNativeEncodingHex.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include