diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml new file mode 100644 index 0000000..608aabf --- /dev/null +++ b/.gitea/workflows/actions.yaml @@ -0,0 +1,56 @@ +name: Prepare Build and Testing executable binary +run-name: ${{ gitea.actor }} +on: [push] + +jobs: + # Prepare-Build-Testing-With-Make: + # runs-on: alpine-sdk + # steps: + # - name: prepare-container + # run: | + # echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ + # apk add openssl openssl-dev + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Building binary with make + # run: | + # echo "#define TEST" >> src/AuthService/AuthService.hpp && \ + # make -j$(nproc) + # - name: Testing to run binary builded with make + # run: ./bin/auth_service + + Prepare-Build-Testing-With-CMake: + runs-on: alpine-sdk + steps: + - name: prepare-container + run: | + echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ + apk add cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with CMake + run: | + echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \ + mkdir build && \ + cd build && \ + cmake .. && \ + make -j$(nproc) + - name: Testing to run binary builded with CMake + run: ./build/openrouter + + Prepare-Build-Testing-With-Meson: + runs-on: alpine-sdk + steps: + - name: prepare-container + run: | + echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ + apk add meson ninja cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with meson + run: | + echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \ + meson setup build && \ + ninja -C build + - name: Testing to run binary builded with meson + run: ./build/openrouter \ No newline at end of file diff --git a/src/openrouter.cpp b/src/openrouter.cpp index 8bbc1c0..0cc8c3c 100644 --- a/src/openrouter.cpp +++ b/src/openrouter.cpp @@ -3,5 +3,9 @@ int main() { OpenRouter router; +#ifdef TEST + return 0; +#else return router.serve("127.0.0.1", 43244); +#endif }