Skip to content

Commit

Permalink
Merge pull request #137 from lluiscampos/qa-duty-ci-chores
Browse files Browse the repository at this point in the history
ci: Miscellaneous improvements
  • Loading branch information
lluiscampos authored Feb 4, 2025
2 parents 8d2a00e + c87289f commit 6482006
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@ stages:
- test
- publish

variables:
# mender-artifact version for tests
MENDER_ARTIFACT_VERSION: 4.0.0

default:
tags:
# Don't run gitlab hosted runners by default
- hetzner-amd-beefy

.test:static:
stage: test
image: ubuntu:24.04
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/ubuntu:24.04
needs: []
before_script:
- apt-get update && apt-get install -y git clang-format pcregrep
tags:
# QA-866: Ubuntu 24.04 image cannot properly run on our private runners.
# Temporarely setting it to GitLab Hosted runners
- saas-linux-medium-amd64

test:static:license:
extends: .test:static
Expand All @@ -30,7 +43,7 @@ test:static:code:

test:smoke-build:posix:
stage: test
image: debian:12-slim
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/debian:12-slim
needs: []
before_script:
- apt-get update && apt-get install -yqq
Expand All @@ -43,7 +56,7 @@ test:smoke-build:posix:

test:smoke-build:weak:
stage: test
image: debian:12-slim
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/debian:12-slim
needs: []
before_script:
- apt-get update && apt-get install -yqq
Expand All @@ -54,29 +67,21 @@ test:smoke-build:weak:
- cmake --build build --parallel $(nproc --all)
- ./build/mender-mcu-client.elf --help

.test:mender-artifact:template:
variables:
DEBIAN_RELEASE: bookworm
MENDER_ARTIFACT_VERSION: 3.11.2

test:unit:
extends: .test:mender-artifact:template
stage: test
image: debian:12-slim
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/debian:12-slim
before_script:
- apt update && apt install -yyq
cmake git make pkg-config python3
libcurl4-openssl-dev libcjson-dev
g++ lcov wget
# Fetch and install mender-artifact
- wget "https://downloads.mender.io/repos/debian/pool/main/m/mender-artifact/mender-artifact_${MENDER_ARTIFACT_VERSION}-1+debian+${DEBIAN_RELEASE}_amd64.deb"
- wget "https://downloads.mender.io/repos/debian/pool/main/m/mender-artifact/mender-artifact_${MENDER_ARTIFACT_VERSION}-1+debian+bookworm_amd64.deb"
-O mender-artifact.deb &&
dpkg --install mender-artifact.deb
script:
- cmake -D COVERAGE=ON tests/unit/
- make --jobs=$(nproc --all) --keep-going coverage
tags:
- hetzner-amd-beefy
artifacts:
expire_in: 2w
reports:
Expand All @@ -85,16 +90,15 @@ test:unit:
- coverage.lcov

.test:static:template:
extends: .test:mender-artifact:template
stage: test
image: ubuntu:24.04
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/ubuntu:24.04
before_script:
- apt update && apt install -yyq
cmake git make pkg-config python3
libcurl4-openssl-dev libcjson-dev
clang wget
# Fetch and install mender-artifact
- wget "https://downloads.mender.io/repos/debian/pool/main/m/mender-artifact/mender-artifact_${MENDER_ARTIFACT_VERSION}-1+debian+${DEBIAN_RELEASE}_amd64.deb"
- wget "https://downloads.mender.io/repos/debian/pool/main/m/mender-artifact/mender-artifact_${MENDER_ARTIFACT_VERSION}-1+ubuntu+noble_amd64.deb"
-O mender-artifact.deb &&
dpkg --install mender-artifact.deb
- export CC=$(which clang)
Expand Down Expand Up @@ -129,7 +133,7 @@ test:static:release:

publish:tests:
stage: publish
image: python:3.11
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.11
dependencies:
- test:unit
before_script:
Expand Down

0 comments on commit 6482006

Please sign in to comment.