diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 000000000..a49585375 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,12 @@ +languages: + - cpp +queries: + - name: Security And Quality + uses: security-and-quality +# "paths"/"paths-ignore" fields of the config only have effect for JavaScript, Python, and Ruby +# paths: +# - include +# - src +# paths-ignore: +# - third_party +# - test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac0a54024..8898f5ab5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: CI Job shell: bash run: | @@ -40,7 +40,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate cache key shell: bash run: git submodule > '.github/.cache-key' @@ -87,7 +87,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate cache key shell: bash run: git submodule > '.github/.cache-key' @@ -116,7 +116,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate cache key shell: bash run: git submodule > '.github/.cache-key' @@ -146,7 +146,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate cache key shell: bash run: git submodule > '.github/.cache-key' @@ -156,17 +156,25 @@ jobs: path: | third_party/install key: ${{ matrix.os }}-coverage-${{ hashFiles('.github/.cache-key') }} - - name: Generate coverage + - name: Configure shell: bash env: USE_CC: ${{ matrix.cc }} VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }} GCOV_FLAGS: "${{ matrix.gcov_flags }}" run: | - bash ci/do_ci.sh coverage ; - - name: Uploaded code coverage - uses: codecov/codecov-action@v1 + bash ci/do_ci.sh codeql.configure + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 with: - # token: ${{secrets.CODECOV_TOKEN}} # not required for public repos - fail_ci_if_error: true - gcov_args: "-lp" + config-file: ./.github/codeql/codeql-config.yml + - name: Build + shell: bash + env: + USE_CC: ${{ matrix.cc }} + run: | + bash ci/do_ci.sh codeql.build + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:cpp" diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c10e4ffe..96c0d59aa 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ enable_testing() project( libatbus - VERSION "2.3.0" + VERSION "2.3.1" HOMEPAGE_URL "https://github.com/atframework/libatbus" LANGUAGES C CXX) diff --git a/LICENSE b/LICENSE index 9cc0534bb..5ba5a211c 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 atframework +Copyright (c) 2023 atframework Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/LICENSE-Apache.txt b/LICENSE-Apache.txt index e3e999982..215f94efc 100644 --- a/LICENSE-Apache.txt +++ b/LICENSE-Apache.txt @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 atframework. + Copyright 2023 atframework. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 978cdc4c5..bad3e1d20 100644 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -76,6 +76,21 @@ elif [[ "$1" == "coverage" ]]; then timeout 5s ./tools/benchmark_shm_channel_recv 12345679 1024 4194304 >recv.log 2>&1 & timeout 6s ./tools/benchmark_shm_channel_send 12345679 1024 4194304 >send.log 2>&1 || true ./tools/show_shm_channel 12345679 1 16 >/dev/null || true +elif [[ "$1" == "codeql.configure" ]]; then + CONFIGURATION=Debug + vcpkg install --triplet=$VCPKG_TARGET_TRIPLET fmt openssl libuv + CRYPTO_OPTIONS="-DATFRAMEWORK_CMAKE_TOOLSET_THIRD_PARTY_CRYPTO_USE_OPENSSL=ON" + bash cmake_dev.sh -lus -b $CONFIGURATION -r build_jobs_coverage -c $USE_CC -- $CRYPTO_OPTIONS "-DCMAKE_C_FLAGS=$GCOV_FLAGS" "-DCMAKE_CXX_FLAGS=$GCOV_FLAGS" \ + "-DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS" -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \ + -DVCPKG_TARGET_TRIPLET=$VCPKG_TARGET_TRIPLET -DATBUS_MACRO_ABORT_ON_PROTECTED_ERROR=ON "-DATFRAMEWORK_CMAKE_TOOLSET_THIRD_PARTY_LOW_MEMORY_MODE=ON" +elif [[ "$1" == "codeql.build" ]]; then + CONFIGURATION=Debug + cd build_jobs_coverage + cmake --build . -j --config $CONFIGURATION || cmake --build . --config $CONFIGURATION + ctest -VV . -C $CONFIGURATION -L libatbus.unit_test + timeout 5s ./tools/benchmark_shm_channel_recv 12345679 1024 4194304 >recv.log 2>&1 & + timeout 6s ./tools/benchmark_shm_channel_send 12345679 1024 4194304 >send.log 2>&1 || true + ./tools/show_shm_channel 12345679 1 16 >/dev/null || true elif [[ "$1" == "ssl.openssl" ]]; then CRYPTO_OPTIONS="-DATFRAMEWORK_CMAKE_TOOLSET_THIRD_PARTY_CRYPTO_USE_OPENSSL=ON" vcpkg install --triplet=$VCPKG_TARGET_TRIPLET fmt openssl libuv