Skip to content

Commit

Permalink
Fix codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed May 5, 2023
1 parent 0ec13b3 commit dd18989
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
12 changes: 12 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 20 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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"
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-Apache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 15 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd18989

Please sign in to comment.