From 0e3511119ffdfb3812012c5fcc21988ce15695da Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 5 Jan 2025 18:31:02 +0700 Subject: [PATCH 1/6] added actions --- .gitea/workflows/actions.yaml | 20 ++++++++++++++++++++ src/auth_service.cpp | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 .gitea/workflows/actions.yaml diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml new file mode 100644 index 0000000..02142c9 --- /dev/null +++ b/.gitea/workflows/actions.yaml @@ -0,0 +1,20 @@ +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 meson ninja cmake + - name: Check out repository code + uses: actions/checkout@v3 + - name: Building binary with make + run: | + echo "#define TEST" >> src/AuthService.hpp && \ + make + - name: Testing to run binary builded with make + run: ./bin/auth_service \ No newline at end of file diff --git a/src/auth_service.cpp b/src/auth_service.cpp index f03e430..0e3519a 100644 --- a/src/auth_service.cpp +++ b/src/auth_service.cpp @@ -2,5 +2,8 @@ int main() { AuthService auth_service; +#ifdef TEST + return 0; +#endif return auth_service.serve("127.0.0.1", 43243); } From a0e14148ca10eed458dda0df707f69c6c6b3c30b Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 5 Jan 2025 18:33:01 +0700 Subject: [PATCH 2/6] added actions --- .gitea/workflows/actions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 02142c9..39f24e4 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -9,7 +9,7 @@ jobs: - name: prepare-container run: | echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ - apk add meson ninja cmake + apk add meson ninja cmake openssl - name: Check out repository code uses: actions/checkout@v3 - name: Building binary with make From cf761f6bc19ac2add8371f94fd72309a97592f9f Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 5 Jan 2025 18:38:00 +0700 Subject: [PATCH 3/6] added actions --- .gitea/workflows/actions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 39f24e4..74f22b3 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -9,7 +9,7 @@ jobs: - name: prepare-container run: | echo "83.172.39.220 gitea.home.com" >> /etc/hosts && \ - apk add meson ninja cmake openssl + apk add openssl openssl-dev - name: Check out repository code uses: actions/checkout@v3 - name: Building binary with make From 6f94d1412635504d02eec4daa5a2143405beb030 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 5 Jan 2025 18:46:22 +0700 Subject: [PATCH 4/6] added actions --- .gitea/workflows/actions.yaml | 38 ++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 74f22b3..9d4172f 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -17,4 +17,40 @@ jobs: echo "#define TEST" >> src/AuthService.hpp && \ make - name: Testing to run binary builded with make - run: ./bin/auth_service \ No newline at end of file + 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.hpp && \ + mkdir build && \ + cd build && \ + cmake .. && \ + make + - 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.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 From eccd6d8e056a135477678020347485aac07a2748 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 5 Jan 2025 18:47:41 +0700 Subject: [PATCH 5/6] added actions --- .gitea/workflows/actions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 9d4172f..c630616 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -15,7 +15,7 @@ jobs: - name: Building binary with make run: | echo "#define TEST" >> src/AuthService.hpp && \ - make + make -j$(nproc) - name: Testing to run binary builded with make run: ./bin/auth_service @@ -34,7 +34,7 @@ jobs: mkdir build && \ cd build && \ cmake .. && \ - make + make -j$(nproc) - name: Testing to run binary builded with CMake run: ./build/auth_service From 2603511bd773ace8aee32695613343f08f365d05 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 5 Jan 2025 18:50:46 +0700 Subject: [PATCH 6/6] added actions --- .gitea/workflows/actions.yaml | 6 +++--- src/auth_service.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index c630616..b3fe1e8 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v3 - name: Building binary with make run: | - echo "#define TEST" >> src/AuthService.hpp && \ + echo "#define TEST" >> src/AuthService/AuthService.hpp && \ make -j$(nproc) - name: Testing to run binary builded with make run: ./bin/auth_service @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v3 - name: Building binary with CMake run: | - echo "#define TEST" >> src/AuthService.hpp && \ + echo "#define TEST" >> src/AuthService/AuthService.hpp && \ mkdir build && \ cd build && \ cmake .. && \ @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@v3 - name: Building binary with meson run: | - echo "#define TEST" >> src/AuthService.hpp && \ + echo "#define TEST" >> src/AuthService/AuthService.hpp && \ meson setup build && \ ninja -C build - name: Testing to run binary builded with meson diff --git a/src/auth_service.cpp b/src/auth_service.cpp index 0e3519a..4e685cf 100644 --- a/src/auth_service.cpp +++ b/src/auth_service.cpp @@ -4,6 +4,7 @@ int main() { AuthService auth_service; #ifdef TEST return 0; -#endif +#else return auth_service.serve("127.0.0.1", 43243); +#endif }