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

CI tool cleanup #589

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ jobs:
- name: Build all binaries
run: |
tools/ci/run_ci.sh \
--clean \
--build \
--run-build \
--c-standard ${{ matrix.c_standard }} \
--c-extensions ${{ matrix.c_extensions }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Build all binaries
run: |
tools/ci/run_ci.sh --build --verbose
tools/ci/run_ci.sh --run-build --verbose
env:
CC: ${{ matrix.compiler }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-static-analyzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: seanmiddleditch/gha-setup-ninja@master

- name: Run Clang Static Analyzer
run: tools/ci/run_ci.sh --build --scan-build scan-build-10
run: tools/ci/run_ci.sh --run-build --scan-build scan-build-10

- name: Upload scan build reports
uses: actions/upload-artifact@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
languages: cpp

- name: Build all binaries
run: tools/ci/run_ci.sh --build
run: tools/ci/run_ci.sh --run-build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:

- name: Collect test coverage data
run: |
tools/ci/run_ci.sh --run-tests \
--build \
--clean \
tools/ci/run_ci.sh \
--run-build \
--run-tests \
--test-coverage html

- name: Upload HTML coverage report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multiarch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
cd ..
rm -r cmake-${{ env.cmake_version }} cmake-${{ env.cmake_version }}.tar.gz
run: |
tools/ci/run_ci.sh --build --run-tests
tools/ci/run_ci.sh --run-build --run-tests
70 changes: 35 additions & 35 deletions tools/ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,44 @@ readonly REPO_ROOT_DIR="${PWD}"
readonly SCRIPT_NAME="$(basename "$0")"

CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
RUN_CLEAN=0
RUN_BUILD=0
RUN_TESTS=0
OPT_C_EXTENSIONS=""
OPT_C_STANDARD=""
OPT_VERBOSE=0
OPT_SANITIZER=""
OPT_TEST_COVERAGE_REPORT=""
OPT_SCAN_BUILD=""
OPT_SONARQUBE=""
OPT_TEST_COVERAGE_REPORT=""
OPT_VERBOSE=0
OPT_WRAPPER_CMD=""
RUN_BUILD=0
RUN_CLEAN=0
RUN_TESTS=0

HELP_MSG="usage: ${SCRIPT_NAME} <OPTIONS>...
Runs build and test steps in CI.
Select steps to execute with --run- options

Options:
-v, --verbose Verbose output
-a, --all Run all steps required for a MR
-h, --help Display this help and exit
--sanitizer TYPE Enable sanitizer
(TYPE: address leak thread undefined)
--scan-build BINARY Enable Clang code analyzer using specified
executable
(BINARY: e.g. scan-build-10)
--test-coverage REPORT Enable code coverage measurement, output REPORT
(REPORT: xml html text none)
--c-standard VERSION Explicitly specify C VERSION to be used
(VERSION: 99, 11)
--c-extensions ENABLE Whether to allow compiler extensions. Defaults to
ON.
(ENABLE: ON or OFF)
--sonarqube WRAPPER Collect data for SonarQube
(WRAPPER: path to build-wrapper)
--c-extensions ENABLE Whether to allow compiler extensions. Defaults to
ON.
(ENABLE: ON or OFF)
--c-standard VERSION Explicitly specify C VERSION to be used
(VERSION: 99, 11)
--sanitizer TYPE Enable sanitizer
(TYPE: address leak thread undefined)
--scan-build BINARY Enable Clang code analyzer using specified
executable
(BINARY: e.g. scan-build-10)
--sonarqube WRAPPER Collect data for SonarQube
(WRAPPER: path to build-wrapper)
--test-coverage REPORT Enable code coverage measurement, output REPORT
(REPORT: xml html text none)
-v, --verbose Verbose output
-a, --all Run all steps required for a MR
-h, --help Display this help and exit

Available steps (executed by --all):
--clean Remove all build artifacts
--build Build all targets
--run-clean Remove all build artifacts
--run-build Build all targets
--run-tests Build and execute tests
"

Expand Down Expand Up @@ -135,15 +135,15 @@ fi

if ! PARSED_OPTS=$(getopt -o vah \
-l all \
-l build \
-l c-extensions: \
-l c-standard: \
-l clean \
-l help \
-l run-build \
-l run-clean \
-l run-tests \
-l sanitizer: \
-l scan-build: \
-l sonarqube: \
-l run-tests \
-l test-coverage: \
-l verbose \
--name "${SCRIPT_NAME}" -- "$@");
Expand All @@ -155,14 +155,6 @@ eval set -- "${PARSED_OPTS}"

while true; do
case "$1" in
--clean)
RUN_CLEAN=1
shift
;;
--build)
RUN_BUILD=1
shift 1
;;
--c-extensions)
OPT_C_EXTENSIONS=$2
shift 2
Expand All @@ -171,6 +163,14 @@ while true; do
OPT_C_STANDARD=$2
shift 2
;;
--run-clean)
RUN_CLEAN=1
shift
;;
--run-build)
RUN_BUILD=1
shift 1
;;
--run-tests)
RUN_TESTS=1
shift
Expand Down