From e4a00366d049b9fb9ce3e9f0e27eeb2877c3ecef Mon Sep 17 00:00:00 2001 From: TalRasha <524948250@qq.com> Date: Mon, 3 Nov 2025 12:19:00 +0800 Subject: [PATCH 1/3] new a git action workflows for CI --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..5adf3776b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI for master branch PR + +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Show version of tools + run: | + gcc -v + g++ -v + make -v + cmake --version + + - name: Cache apt packages + uses: actions/cache@v3 + with: + path: /var/cache/apt/archives/*.deb + key: ${{ runner.os }}-apt-${{ hashFiles('apt-packages.txt') }} + + - name: Install dependencies + run: | + - sudo apt-get install libboost-dev + - sudo apt-get install libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev + - sudo apt-get install libboost-test-dev libboost-program-options-dev libboost-system-dev + - sudo apt-get install libc-ares-dev libcurl4-openssl-dev + - sudo apt-get install zlib1g-dev libgd-dev From 7665fd1feb1218434fc1b1b38ef69cfe30abae17 Mon Sep 17 00:00:00 2001 From: TalRasha <524948250@qq.com> Date: Mon, 3 Nov 2025 12:22:46 +0800 Subject: [PATCH 2/3] fix errors --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5adf3776b..5f687d6b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,8 @@ jobs: - name: Install dependencies run: | - - sudo apt-get install libboost-dev - - sudo apt-get install libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev - - sudo apt-get install libboost-test-dev libboost-program-options-dev libboost-system-dev - - sudo apt-get install libc-ares-dev libcurl4-openssl-dev - - sudo apt-get install zlib1g-dev libgd-dev + sudo apt-get install libboost-dev + sudo apt-get install libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev + sudo apt-get install libboost-test-dev libboost-program-options-dev libboost-system-dev + sudo apt-get install libc-ares-dev libcurl4-openssl-dev + sudo apt-get install zlib1g-dev libgd-dev From 267277f67acc91bd2c334b94793489dd72a89440 Mon Sep 17 00:00:00 2001 From: TalRasha <524948250@qq.com> Date: Mon, 3 Nov 2025 12:26:37 +0800 Subject: [PATCH 3/3] doing build in workflow --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f687d6b7..8d9fc7a1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,12 @@ jobs: sudo apt-get install libboost-test-dev libboost-program-options-dev libboost-system-dev sudo apt-get install libc-ares-dev libcurl4-openssl-dev sudo apt-get install zlib1g-dev libgd-dev + + - name: Set up environment variables + run: | + echo "BUILD_TYPE=debug" >> $GITHUB_ENV + echo "BUILD_TYPE=release" >> $GITHUB_ENV + + - name: Build project + run: | + ./build.sh