diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml new file mode 100644 index 0000000..b3fe1e8 --- /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 openssl openssl-dev cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with CMake + run: | + echo "#define TEST" >> src/AuthService/AuthService.hpp && \ + mkdir build && \ + cd build && \ + cmake .. && \ + make -j$(nproc) + - name: Testing to run binary builded with CMake + run: ./build/auth_service + + 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 openssl openssl-dev meson ninja cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with meson + run: | + echo "#define TEST" >> src/AuthService/AuthService.hpp && \ + meson setup build && \ + ninja -C build + - name: Testing to run binary builded with meson + run: ./build/auth_service \ No newline at end of file diff --git a/src/auth_service.cpp b/src/auth_service.cpp index f03e430..4e685cf 100644 --- a/src/auth_service.cpp +++ b/src/auth_service.cpp @@ -2,5 +2,9 @@ int main() { AuthService auth_service; +#ifdef TEST + return 0; +#else return auth_service.serve("127.0.0.1", 43243); +#endif }