Skip to content

Commit

Permalink
Github Action for Android NDK (#4321)
Browse files Browse the repository at this point in the history
* Add first android git hub action to try

* Set up android toolchain

* Add second android ndk build

* add some default settings for android

* Add a third android build for armv7

* fix(OpMsgMessage): android v7a compile

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
  • Loading branch information
Bjoe and aleks-f authored Dec 11, 2023
1 parent 4f1cf68 commit ec3c0f4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@ concurrency:
cancel-in-progress: true

jobs:
android-arm64-v8a-ndk-latest-cmake:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
add-to-path: true
- run: cmake -S$GITHUB_WORKSPACE -B$HOME/android-build -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-21 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake && cmake --build $HOME/android-build --target all

android-arm64-v8a-ndk-cmake:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
add-to-path: true
- run: cmake -S$GITHUB_WORKSPACE -B$HOME/android-build -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-21 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake && cmake --build $HOME/android-build --target all

android-armeabi-v7a-ndk-cmake:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
add-to-path: true
- run: cmake -S$GITHUB_WORKSPACE -B$HOME/android-build -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-21 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake && cmake --build $HOME/android-build --target all

linux-gcc-make:
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -114,7 +144,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: sudo apt -y update && sudo apt -y install cmake ninja-build libssl-dev unixodbc-dev libmysqlclient-dev redis-server
- run: cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
- run: cmake -S. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
- uses: ./.github/actions/retry-action
with:
timeout_minutes: 90
Expand Down Expand Up @@ -193,7 +223,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: brew install openssl@1.1 mysql-client unixodbc libpq
- run: cmake -H. -Bcmake-build -DENABLE_PDF=OFF -DENABLE_TESTS=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 -DMYSQL_ROOT_DIR=/usr/local/opt/mysql-client && cmake --build cmake-build --target all
- run: cmake -S. -Bcmake-build -DENABLE_PDF=OFF -DENABLE_TESTS=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 -DMYSQL_ROOT_DIR=/usr/local/opt/mysql-client && cmake --build cmake-build --target all
- uses: ./.github/actions/retry-action
with:
timeout_minutes: 90
Expand All @@ -218,7 +248,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: brew install openssl@3 mysql-client unixodbc libpq
- run: cmake -H. -Bcmake-build -DENABLE_PDF=OFF -DENABLE_TESTS=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 -DMYSQL_ROOT_DIR=/usr/local/opt/mysql-client && cmake --build cmake-build --target all
- run: cmake -S. -Bcmake-build -DENABLE_PDF=OFF -DENABLE_TESTS=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 -DMYSQL_ROOT_DIR=/usr/local/opt/mysql-client && cmake --build cmake-build --target all
- uses: ./.github/actions/retry-action
with:
timeout_minutes: 90
Expand Down
8 changes: 4 additions & 4 deletions MongoDB/src/OpMsgMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const std::string OpMsgMessage::CMD_COUNT { "count" };
const std::string OpMsgMessage::CMD_DISTINCT { "distinct" };
const std::string OpMsgMessage::CMD_MAP_REDUCE { "mapReduce" };

// Replication and administration
// Replication and administration
const std::string OpMsgMessage::CMD_HELLO { "hello" };
const std::string OpMsgMessage::CMD_REPL_SET_GET_STATUS { "replSetGetStatus" };
const std::string OpMsgMessage::CMD_REPL_SET_GET_CONFIG { "replSetGetConfig" };
Expand Down Expand Up @@ -104,7 +104,7 @@ void OpMsgMessage::setCommandName(const std::string& command)
// IMPORTANT: Command name must be first
if (_collectionName.empty())
{
// Collection is not specified. It is assumed that this particular command does
// Collection is not specified. It is assumed that this particular command does
// not need it.
_body.add(_commandName, Int32(1));
}
Expand Down Expand Up @@ -280,7 +280,7 @@ void OpMsgMessage::read(std::istream& istr)

poco_assert_dbg(_header.opCode() == _header.OP_MSG);

const std::streamsize remainingSize {_header.getMessageLength() - _header.MSG_HEADER_SIZE };
const std::streamsize remainingSize { static_cast<std::streamsize>(_header.getMessageLength() - _header.MSG_HEADER_SIZE) };
message.reserve(remainingSize);

#if POCO_MONGODB_DUMP
Expand All @@ -289,7 +289,7 @@ void OpMsgMessage::read(std::istream& istr)
<< _header.opCode() << " " << _header.getRequestID() << " " << _header.responseTo()
<< std::endl;
#endif

reader.readRaw(remainingSize, message);

#if POCO_MONGODB_DUMP
Expand Down

0 comments on commit ec3c0f4

Please sign in to comment.