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

Enable cache in gitlab ci #100

Merged
merged 2 commits into from
Nov 25, 2024
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
53 changes: 51 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ include:

variables:
OPEN_IOT_SDK_DOCKER_VERSION: v2
KUBERNETES_CPU_REQUEST: 1
KUBERNETES_MEMORY_REQUEST: 1Gi
GIT_SUBMODULE_STRATEGY: none
RETRY_LIMIT: 100

Expand Down Expand Up @@ -52,6 +50,22 @@ workflow:
before_script:
- python -m pip install pyelftools
script:
- |
apt-get update -y && \
apt-get install ccache -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists
- ccache -o cache_dir=/cache/$CI_JOB_NAME_SLUG/.ccache
- ccache -p
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-cpp
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-c++
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-ar
- ln -s /usr/bin/ccache /usr/lib/ccache/armclang
- ln -s /usr/bin/ccache /usr/lib/ccache/armar
- export PATH=/usr/lib/ccache:$PATH
- echo $PATH
- export APP_UNDERSCORED=$(echo ${APP} | tr '-' '_')
- ./tools/ci/generate_credentials.sh -f -p applications/${APP_UNDERSCORED}/configs/aws_configs
- git config --global user.email "[email protected]"
Expand Down Expand Up @@ -79,6 +93,11 @@ workflow:
build/CMakeCache.txt \
applications/${APP_UNDERSCORED}/configs/aws_configs
fi
- ccache -s
variables:
KUBERNETES_CPU_REQUEST: 8
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 10Gi
KUBERNETES_MEMORY_REQUEST: 12Gi

# Build Corstone320 applications which later are tested.
build-applications-corstone320:
Expand Down Expand Up @@ -192,6 +211,9 @@ build-applications-corstone300:
- *pipeline_config_corstone300
variables:
PYTHONUNBUFFERED: 1
KUBERNETES_CPU_REQUEST: 16
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 10Gi
KUBERNETES_MEMORY_REQUEST: 12Gi

test-blinky-output:
extends: .test_job
Expand Down Expand Up @@ -359,6 +381,22 @@ integration-tests:
rules:
- if: ( $SCHEDULED_JOB_TO_RUN == "integration-tests" )
script:
- |
apt-get update -y && \
apt-get install ccache -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists
- ccache -o cache_dir=/cache/$CI_JOB_NAME_SLUG/.ccache
- ccache -p
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-cpp
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-c++
- ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-ar
- ln -s /usr/bin/ccache /usr/lib/ccache/armclang
- ln -s /usr/bin/ccache /usr/lib/ccache/armar
- export PATH=/usr/lib/ccache:$PATH
- echo $PATH
- export APP_UNDERSCORED=$(echo ${APP} | tr '-' '_')
- ./tools/ci/generate_credentials.sh -f -p applications/${APP_UNDERSCORED}/configs/aws_configs
- git config --global user.email "[email protected]"
Expand Down Expand Up @@ -390,6 +428,7 @@ integration-tests:
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--timeout-seconds 14400
- ccache -s
parallel:
matrix:
-
Expand Down Expand Up @@ -527,6 +566,10 @@ sw-vsi-configs-test:
- runner_system_failure
variables:
GIT_SUBMODULE_STRATEGY: recursive
KUBERNETES_CPU_REQUEST: 16
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 10Gi
KUBERNETES_MEMORY_REQUEST: 12Gi


gnu-toolchain-test:
tags:
Expand Down Expand Up @@ -602,6 +645,9 @@ gnu-toolchain-test:
- runner_system_failure
variables:
GIT_SUBMODULE_STRATEGY: recursive
KUBERNETES_CPU_REQUEST: 16
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 10Gi
KUBERNETES_MEMORY_REQUEST: 12Gi

iot-vsocket-psa-crypto-mbedtls-test:
tags:
Expand Down Expand Up @@ -661,6 +707,9 @@ iot-vsocket-psa-crypto-mbedtls-test:
- runner_system_failure
variables:
GIT_SUBMODULE_STRATEGY: recursive
KUBERNETES_CPU_REQUEST: 16
KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 10Gi
KUBERNETES_MEMORY_REQUEST: 12Gi

########################
# Black Duck scan #
Expand Down
1 change: 1 addition & 0 deletions release_changes/202411201651.change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: Enable gitlab-ci cache
Loading