Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
ci: adds gitlab-ci basic configuration
Browse files Browse the repository at this point in the history
It is added a basic structure for CI testing on GitlabCI. It is
introduced two pipelines:
-  `daily-pipeline`: intended to be run periodically where all
checks are performed.
-  `deployment-pipeline`: run a set of basic tests.

Signed-off-by: Leandro Belli <[email protected]>
Change-Id: Ib11db1db682055b889a4fdfb3636a905a7df1280
  • Loading branch information
leandro-arm committed Mar 21, 2024
1 parent 59c03d0 commit 7ad2722
Show file tree
Hide file tree
Showing 7 changed files with 224 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitlab/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

variables:
PIPELINE_TYPE:
value: "deployment-pipeline"
options:
- "deployment-pipeline"
- "daily-pipeline"
description: "The CI pipeline to run"

include:
- local: .gitlab/pipelines/deployment-pipeline.yml
rules:
- if: $PIPELINE_TYPE == "deployment-pipeline"

- local: .gitlab/pipelines/daily-pipeline.yml
rules:
- if: $PIPELINE_TYPE == "daily-pipeline"
42 changes: 42 additions & 0 deletions .gitlab/pipelines/daily-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

stages:
- linting
- static-analysis
- unit-testing
- build

include:
- local: .gitlab/templates/linting.yml
- local: .gitlab/templates/static-analysis.yml
- local: .gitlab/templates/unit-test.yml
- local: .gitlab/templates/build-test.yml

check-lint:
extends: .check-lint
stage: linting
allow_failure: true

banned-api:
extends: .banned-api
stage: static-analysis
allow_failure: true

check-fwk:
extends: .check-fwk
stage: unit-testing
allow_failure: true

check-modules:
extends: .check-modules
stage: unit-testing
allow_failure: true

build-products-all-log-levels:
extends: .build-products-all-log-levels
stage: build
46 changes: 46 additions & 0 deletions .gitlab/pipelines/deployment-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

stages:
- linting
- static-analysis
- unit-testing
- build

include:
- local: .gitlab/templates/linting.yml
- local: .gitlab/templates/static-analysis.yml
- local: .gitlab/templates/unit-test.yml
- local: .gitlab/templates/build-test.yml

check-lint:
extends: .check-lint
stage: linting

check-copyright:
extends: .check-copyright
stage: linting

check-style:
extends: .check-style
stage: linting

banned-api:
extends: .banned-api
stage: static-analysis

check-fwk:
extends: .check-fwk
stage: unit-testing

check-modules:
extends: .check-modules
stage: unit-testing

build-products:
extends: .build-products
stage: build
40 changes: 40 additions & 0 deletions .gitlab/templates/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

.build-products:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: 1
before_script:
- |
if [ -z $BUILD_PRODUCTS_LOG_LEVEL ]; then
export LOG_LEVEL=""
else
export LOG_LEVEL="--log-level=$BUILD_PRODUCTS_LOG_LEVEL"
fi
script:
- |
python3 tools/check_build.py --build-output-dir ./build \
${LOG_LEVEL}
artifacts:
when: on_failure
expire_in: 2 days
paths:
- build/*.txt

.build-products-all-log-levels:
extends: .build-products
parallel:
matrix:
- BUILD_PRODUCTS_LOG_LEVEL:
- DEBUG
- INFO
- WARN
- ERROR
- CRIT
- DISABLED
33 changes: 33 additions & 0 deletions .gitlab/templates/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

.check-lint:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
script:
- python3 tools/${CHECK_SCRIPT}.py
parallel:
matrix:
- CHECK_SCRIPT:
- check_doc
- check_pycodestyle
- check_spacing
- check_tabs

.check-copyright:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
script:
- python3 tools/check_copyright.py -c "${CI_MERGE_REQUEST_DIFF_BASE_SHA}"

.check-style:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
script:
- python3 tools/check_style.py -c "${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
artifacts:
when: on_failure
expire_in: 2 days
paths:
- code-style.patch
11 changes: 11 additions & 0 deletions .gitlab/templates/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

.banned-api:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
script:
- python3 tools/check_api.py
29 changes: 29 additions & 0 deletions .gitlab/templates/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

.check-fwk:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
script:
- python3 tools/check_framework.py --coverage
artifacts:
when: on_success
expire_in: 2 days
paths:
- build/module/test/scp_v2_fwk_test_coverage_filtered.info

.check-modules:
image: ${CI_REGISTRY_IMAGE}/ci-base:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: 1
script:
- python3 tools/check_module_utest.py --coverage
artifacts:
when: on_success
expire_in: 2 days
paths:
- build/module/test/scp_v2_unit_test_coverage_filtered.info

0 comments on commit 7ad2722

Please sign in to comment.