Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/kevingpqi test #74

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9114965
Create AutoTest.yml
kevingpqi123 Jan 23, 2022
329e9a0
Create autotest.sh
kevingpqi123 Jan 23, 2022
cd5c056
Update AutoTest.yml
kevingpqi123 Jan 23, 2022
e27eb20
Update AutoTest.yml
kevingpqi123 Jan 23, 2022
79b1f7a
Create cmake.yml
kevingpqi123 Jan 23, 2022
abb88a1
Update cmake.yml
kevingpqi123 Jan 23, 2022
9cb2a5d
Update AutoTest.yml
kevingpqi123 Jan 23, 2022
e59819e
Update cmake.yml
kevingpqi123 Jan 23, 2022
0ceceaa
Update cmake.yml
kevingpqi123 Jan 23, 2022
e0a3a22
Update cmake.yml
kevingpqi123 Jan 23, 2022
476745d
Update cmake.yml
kevingpqi123 Jan 23, 2022
9ec9acd
Update cmake.yml
kevingpqi123 Jan 23, 2022
7121908
Update cmake.yml
kevingpqi123 Jan 23, 2022
5b893cb
Update cmake.yml
kevingpqi123 Jan 24, 2022
249e6ef
Update cmake.yml
kevingpqi123 Jan 24, 2022
a9080d9
Update cmake.yml
kevingpqi123 Jan 24, 2022
ba60fa0
Update autotest.sh
kevingpqi123 Jan 24, 2022
6a0b91b
Update cmake.yml
kevingpqi123 Jan 24, 2022
8c18e9b
Update autotest.sh
kevingpqi123 Jan 24, 2022
c63d332
Create codeql-analysis.yml
kevingpqi123 Jan 25, 2022
628d65b
Update codeql-analysis.yml
kevingpqi123 Jan 25, 2022
172cc86
Update codeql-analysis.yml
kevingpqi123 Jan 25, 2022
5dccece
Create code-format.yml
kevingpqi123 Jan 25, 2022
4af6567
Create codeformat.sh
kevingpqi123 Jan 25, 2022
1b1efa6
apply code-format changes
kevingpqi123 Jan 25, 2022
0522a2e
Update codeql-analysis.yml
kevingpqi123 Jan 25, 2022
9246919
Update code-format.yml
kevingpqi123 Jan 25, 2022
c1b1ac7
更新MR自动化测试
kevingpqi123 Jan 25, 2022
0f3f609
完善autotest
kevingpqi123 Jan 25, 2022
9116f62
完善autotest
kevingpqi123 Jan 25, 2022
ba1c2bc
Update code-format.yml
kevingpqi123 Jan 25, 2022
604c320
update autotest
kevingpqi123 Jan 25, 2022
244c9f7
Create code-format.yml
kevingpqi123 Jan 25, 2022
2a43b35
Revert "apply code-format changes"
kevingpqi123 Jan 25, 2022
6d3b316
书写错误
kevingpqi123 Jan 25, 2022
b5b8f99
test
kevingpqi123 Jan 26, 2022
442445e
test
kevingpqi123 Jan 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: autotest

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Run sync_deps script
run: ./sync_deps.sh
shell: bash
- name: Run autotest script
run: |
chmod +x autotest.sh
./autotest.sh
shell: bash
- uses: actions/upload-artifact@v2
with:
name: result
path: result






21 changes: 21 additions & 0 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: code-format

on: [push, pull_request, pull_request_target]

concurrency:
group: code-format-${{ github.ref }}
cancel-in-progress: true

jobs:
code-format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- uses: DoozyX/[email protected]
with:
source: './src ./test'
exclude: '.'
extensions: 'h,cpp'
clangFormatVersion: 12
style: google
83 changes: 83 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
paths:
- 'src/**'
- 'test/**'
schedule:
- cron: '0 20 * * 4'

jobs:
analyze:
name: Analyze
runs-on: macos-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Install Dependencies
run: |
pip install diff_cover
brew install gcovr
- name: Run sync_deps script
run: ./sync_deps.sh
shell: bash

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion Linux_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
## Linux demo
The library files that the sample project depends on come from the previous step.


#test11

52 changes: 52 additions & 0 deletions autotest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

function make_dir() {
rm -rf $1
mkdir -p $1
}

echo "shell log - autotest start begin "

echo `pwd`

WORKSPACE=$(pwd)

cd $WORKSPACE

make_dir result
make_dir build

cd build

cmake -DcppFlags="-fprofile-arcs -ftest-coverage -g -O0" ../
if test $? -eq 0
then
echo "~~~~~~~~~~~~~~~~~~~CMakeLists OK~~~~~~~~~~~~~~~~~~"
else
echo "~~~~~~~~~~~~~~~~~~~CMakeLists error~~~~~~~~~~~~~~~~~~"
exit -1
fi

cmake --build . --target PAGFullTest -- -j 12
if test $? -eq 0
then
echo "~~~~~~~~~~~~~~~~~~~PAGFullTest make successed~~~~~~~~~~~~~~~~~~"
else
echo "~~~~~~~~~~~~~~~~~~~PAGFullTest make error~~~~~~~~~~~~~~~~~~"
exit -1
fi

./PAGFullTest --gtest_output=json > $WORKSPACE/result/autotest.json

if test $? -eq 0

then
echo "~~~~~~~~~~~~~~~~~~~PAGFullTest successed~~~~~~~~~~~~~~~~~~"
else
echo "~~~~~~~~~~~~~~~~~~~PAGFullTest Failed~~~~~~~~~~~~~~~~~~"
cp -a $WORKSPACE/test/out/*.json $WORKSPACE/result/
cp -a $WORKSPACE/test/out/*.png $WORKSPACE/result/
exit -1
fi

cp -a $WORKSPACE/build/test_detail.json $WORKSPACE/result/
11 changes: 11 additions & 0 deletions codeformat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

# we run clang-format and astyle twice to get stable format output

find src/ test/ -type f -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' xargs -i clang-format -i {}
astyle -n -r "src/*.h,*.cpp,*.cc"
astyle -n -r "test/*.h,*.cpp,*.cc"

find src/ test/ -type f -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' xargs -i clang-format -i {}
astyle -n -r "src/*.h,*.cpp,*.cc"
astyle -n -r "test/*.h,*.cpp,*.cc"