diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml index 58e430c1..7a0d6c7c 100644 --- a/.github/workflows/auto-pr.yml +++ b/.github/workflows/auto-pr.yml @@ -13,7 +13,7 @@ jobs: GH_TOKEN: ${{ github.token }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Pull Request to the next higher release version diff --git a/.github/workflows/ci.linux.arm.yml b/.github/workflows/ci.linux.arm.yml index bd045a5a..81f2d92d 100644 --- a/.github/workflows/ci.linux.arm.yml +++ b/.github/workflows/ci.linux.arm.yml @@ -15,13 +15,13 @@ jobs: options: --cpus 4 steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | @@ -48,13 +48,13 @@ jobs: options: --cpus 4 steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | diff --git a/.github/workflows/ci.linux.x86-64.yml b/.github/workflows/ci.linux.x86-64.yml index ce41d02a..08c1c8b1 100644 --- a/.github/workflows/ci.linux.x86-64.yml +++ b/.github/workflows/ci.linux.x86-64.yml @@ -8,9 +8,17 @@ on: jobs: gcc850: - runs-on: [self-hosted, compiler] + runs-on: ubuntu-latest + container: + image: ghcr.io/coldwings/photon-ut-base:latest + options: --cpus 4 --privileged steps: - - uses: actions/checkout@v3 + - uses: szenius/set-timezone@v2.0 + with: + timezoneLinux: "Asia/Shanghai" + timezoneMacos: "Asia/Shanghai" + timezoneWindows: "China Standard Time" + - uses: actions/checkout@v4 - name: Build850 run: | rm -fr build @@ -20,45 +28,10 @@ jobs: -D PHOTON_ENABLE_SASL=ON \ -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_URING=ON \ - -D PHOTON_ENABLE_EXTFS=ON \ - # -D PHOTON_BUILD_DEPENDENCIES=ON \ - # -D PHOTON_AIO_SOURCE="" \ - # -D PHOTON_ZLIB_SOURCE="" \ - # -D PHOTON_CURL_SOURCE="" \ - # -D PHOTON_OPENSSL_SOURCE="" \ - # -D PHOTON_GFLAGS_SOURCE="" \ - # -D PHOTON_GOOGLETEST_SOURCE="" \ - # -D PHOTON_URING_SOURCE=https://github.com/axboe/liburing/archive/refs/tags/liburing-2.3.tar.gz - + -D PHOTON_ENABLE_EXTFS=ON cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - ln -f common/checksum/test/checksum.in build/output/ - tar -c -h --use-compress-program=zstdmt -f output850.tzs build/output/ - - name: Upload850 - uses: actions/upload-artifact@v4 - with: - name: output850 - path: output850.tzs - retention-days: 5 - compression-level: 0 - - test850: - needs: gcc850 - runs-on: ubuntu-latest - container: - image: ghcr.io/coldwings/photon-ut-base:latest - options: --cpus 4 --privileged - steps: - - uses: szenius/set-timezone@v1.2 - with: - timezoneLinux: "Asia/Shanghai" - timezoneMacos: "Asia/Shanghai" - timezoneWindows: "China Standard Time" - - uses: actions/download-artifact@v4 - with: - name: output850 - name: test run: | - tar -x --use-compress-program=zstdmt -f output850.tzs cd build/output/ ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring @@ -67,41 +40,31 @@ jobs: ctest -E test-lockfree --timeout 3600 -V gcc921: - needs: gcc850 - runs-on: [self-hosted, compiler] - steps: - - name: Build921 - run: | - source /opt/rh/gcc-toolset-9/enable - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - ln -f common/checksum/test/checksum.in build/output/ - tar -c --use-compress-program=zstdmt -f output921.tzs build/output/ - - name: Upload921 - uses: actions/upload-artifact@v4 - with: - name: output921 - path: output921.tzs - retention-days: 5 - compression-level: 0 - - test921: - needs: gcc921 runs-on: ubuntu-latest container: image: ghcr.io/coldwings/photon-ut-base:latest options: --cpus 4 --privileged steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/download-artifact@v4 - with: - name: output921 + - uses: actions/checkout@v4 + - name: Build921 + run: | + source /opt/rh/gcc-toolset-9/enable + rm -fr build + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON \ + -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_URING=ON \ + -D PHOTON_ENABLE_EXTFS=ON + cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - name: test run: | - tar -x --use-compress-program=zstdmt -f output921.tzs cd build/output/ ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring @@ -110,41 +73,31 @@ jobs: ctest -E test-lockfree --timeout 3600 -V gcc1031: - needs: gcc921 - runs-on: [self-hosted, compiler] - steps: - - name: Build1031 - run: | - source /opt/rh/gcc-toolset-10/enable - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - ln -f common/checksum/test/checksum.in build/output/ - tar -c --use-compress-program=zstdmt -f output1031.tzs build/output/ - - name: Upload1031 - uses: actions/upload-artifact@v4 - with: - name: output1031 - path: output1031.tzs - retention-days: 5 - compression-level: 0 - - test1031: - needs: gcc1031 runs-on: ubuntu-latest container: image: ghcr.io/coldwings/photon-ut-base:latest options: --cpus 4 --privileged steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/download-artifact@v4 - with: - name: output1031 + - uses: actions/checkout@v4 + - name: Build1031 + run: | + source /opt/rh/gcc-toolset-10/enable + rm -fr build + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON \ + -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_URING=ON \ + -D PHOTON_ENABLE_EXTFS=ON + cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - name: test run: | - tar -x --use-compress-program=zstdmt -f output1031.tzs cd build/output/ ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring @@ -153,41 +106,31 @@ jobs: ctest -E test-lockfree --timeout 3600 -V gcc1121: - needs: gcc1031 - runs-on: [self-hosted, compiler] - steps: - - name: Build1121 - run: | - source /opt/rh/gcc-toolset-10/enable - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - ln -f common/checksum/test/checksum.in build/output/ - tar -c --use-compress-program=zstdmt -f output1121.tzs build/output/ - - name: Upload1121 - uses: actions/upload-artifact@v4 - with: - name: output1121 - path: output1121.tzs - retention-days: 5 - compression-level: 0 - - test1121: - needs: gcc1121 runs-on: ubuntu-latest container: image: ghcr.io/coldwings/photon-ut-base:latest options: --cpus 4 --privileged steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/download-artifact@v4 - with: - name: output1121 + - uses: actions/checkout@v4 + - name: Build1121 + run: | + source /opt/rh/gcc-toolset-11/enable + rm -fr build + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON \ + -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_URING=ON \ + -D PHOTON_ENABLE_EXTFS=ON + cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - name: test run: | - tar -x --use-compress-program=zstdmt -f output1121.tzs cd build/output/ ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring @@ -196,41 +139,31 @@ jobs: ctest -E test-lockfree --timeout 3600 -V gcc1211: - needs: gcc1121 - runs-on: [self-hosted, compiler] - steps: - - name: Build1211 - run: | - source /opt/rh/gcc-toolset-10/enable - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - ln -f common/checksum/test/checksum.in build/output/ - tar -c --use-compress-program=zstdmt -f output1211.tzs build/output/ - - name: Upload1211 - uses: actions/upload-artifact@v4 - with: - name: output1211 - path: output1211.tzs - retention-days: 5 - compression-level: 0 - - test1211: - needs: gcc1211 runs-on: ubuntu-latest container: image: ghcr.io/coldwings/photon-ut-base:latest options: --cpus 4 --privileged steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/download-artifact@v4 - with: - name: output1211 + - uses: actions/checkout@v4 + - name: Build1211 + run: | + source /opt/rh/gcc-toolset-12/enable + rm -fr build + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON \ + -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_URING=ON \ + -D PHOTON_ENABLE_EXTFS=ON + cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - name: test run: | - tar -x --use-compress-program=zstdmt -f output1211.tzs cd build/output/ ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring @@ -238,4 +171,3 @@ jobs: export PHOTON_CI_EV_ENGINE=epoll_ng ctest -E test-lockfree --timeout 3600 -V - diff --git a/.github/workflows/ci.macos.arm.yml b/.github/workflows/ci.macos.arm.yml index 737e6600..e7e14f96 100644 --- a/.github/workflows/ci.macos.arm.yml +++ b/.github/workflows/ci.macos.arm.yml @@ -11,13 +11,13 @@ jobs: runs-on: macos-14 steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Dependencies shell: bash diff --git a/.github/workflows/ci.macos.x86.yml b/.github/workflows/ci.macos.x86.yml index 81e6bf34..240239e5 100644 --- a/.github/workflows/ci.macos.x86.yml +++ b/.github/workflows/ci.macos.x86.yml @@ -11,13 +11,13 @@ jobs: runs-on: macos-13 steps: - - uses: szenius/set-timezone@v1.2 + - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Asia/Shanghai" timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Dependencies shell: bash diff --git a/common/iovector.h b/common/iovector.h index 72800027..cdab146f 100644 --- a/common/iovector.h +++ b/common/iovector.h @@ -40,8 +40,10 @@ limitations under the License. #include #pragma GCC diagnostic push -#if __GNUC__ >= 13 +#if defined(__clang__) #pragma GCC diagnostic ignored "-Wunknown-warning-option" +#endif +#if __GNUC__ >= 12 #pragma GCC diagnostic ignored "-Wzero-length-bounds" #endif diff --git a/common/test/test.cpp b/common/test/test.cpp index 7cd02c39..8e11c380 100644 --- a/common/test/test.cpp +++ b/common/test/test.cpp @@ -247,7 +247,7 @@ TEST(Callback, virtual_function) // Callback ee([&](int x){ return RET + x/2; }); #pragma GCC diagnostic push -#if __GNUC__ >= 13 +#if __GNUC__ >= 12 #pragma GCC diagnostic ignored "-Wdangling-pointer" #endif THIS = (BB*)&c; diff --git a/rpc/rpc.cpp b/rpc/rpc.cpp index 7fcf96db..01c6b88d 100644 --- a/rpc/rpc.cpp +++ b/rpc/rpc.cpp @@ -325,8 +325,10 @@ namespace rpc { return -1; #pragma GCC diagnostic push -#if __GNUC__ >= 13 +#if defined(__clang__) #pragma GCC diagnostic ignored "-Wunknown-warning-option" +#endif +#if __GNUC__ >= 12 #pragma GCC diagnostic ignored "-Wdangling-pointer" #endif ThreadLink node; diff --git a/test/ci-tools.cpp b/test/ci-tools.cpp index debc37f9..4f5b2240 100644 --- a/test/ci-tools.cpp +++ b/test/ci-tools.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace photon { diff --git a/thread/test/test-pool.cpp b/thread/test/test-pool.cpp index d56997cf..8a394b16 100644 --- a/thread/test/test-pool.cpp +++ b/thread/test/test-pool.cpp @@ -13,6 +13,7 @@ #include #include #include "../../test/ci-tools.h" +#include DEFINE_int32(ths_total, 100, "total threads when testing threadpool.");