1
0
Fork 0
android_external_drm_hwcomp.../.gitlab-ci.yml
Mattijs Korpershoek ca89ea5a92 drm_hwcomposer: CI: use local container image for building
The freedesktop instance provides a docker container registry with
ubuntu 23.04 based images ready to be used for building drm_hwcomposer.

Migrate to using that container image in order to:
- Avoid apt-get installing all dependencies for each job
- Remove duplication between the Dockerfile and the .gitlab-ci.yml

Since the container image provides aospless, we no longer need to download it
for each pipeline stage.
Also, this updates the folder structure:

Before:
/builds/drm-hwcomposer/drm-hwcomposer/
/builds/drm-hwcomposer/aospless

After:
/builds/drm-hwcomposer/drm-hwcomposer/
/home/user/aospless

For "tidy", this new structure requires to override the BASE_DIR variable.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-07-12 16:36:49 +00:00

60 lines
1.3 KiB
YAML

workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'push'
variables:
DEBIAN_FRONTEND: noninteractive
DOCKER_IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
stages:
- build-container
- build
- tidy
- style
build-container:
stage: build-container
image: docker:27.0.3
services:
- docker:27.0.3-dind
variables:
DOCKER_TLS_CERTDIR: ""
before_script:
- echo "$CI_JOB_TOKEN" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
script:
- docker build -t $DOCKER_IMAGE_TAG -f .ci/Dockerfile .
- docker push $DOCKER_IMAGE_TAG
after_script:
- docker logout
build:
stage: build
image: $DOCKER_IMAGE_TAG
script:
- mkdir -p install/arm64
- rm ${HOME}/aospless/src
- ln -s ${PWD} ${HOME}/aospless/src
- make -C ${HOME}/aospless all
- cp -r ${HOME}/aospless/install/* install/arm64
artifacts:
paths:
- install/
expire_in: 1 week
tidy:
stage: tidy
image: $DOCKER_IMAGE_TAG
script:
- rm ${HOME}/aospless/src
- ln -s ${PWD} ${HOME}/aospless/src
- BASE_DIR=${HOME}/aospless make -f .ci/Makefile
checkstyle:
stage: style
image: $DOCKER_IMAGE_TAG
script: "./.ci/.gitlab-ci-checkcommit.sh"
artifacts:
when: on_failure
untracked: true