BUILD: Added continuous integration.
This commit is contained in:
parent
33e6e00e61
commit
2bc6632f12
|
@ -0,0 +1,87 @@
|
|||
#
|
||||
# Gitlab CI Configuration
|
||||
#
|
||||
# Copyright (C) 2019-2025 Udo Steinberg, BlueRock Security, Inc.
|
||||
#
|
||||
# This file is part of the NOVA microhypervisor.
|
||||
#
|
||||
# NOVA is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# NOVA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License version 2 for more details.
|
||||
#
|
||||
|
||||
variables:
|
||||
GIT_DEPTH: 5
|
||||
|
||||
default:
|
||||
image: registry.gitlab.com/bedrocksystems/docker-image:latest
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_DRAFT == "true"' # skip draft MRs
|
||||
when: never
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # push to default branch
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG' # push to any tag
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' # merge request
|
||||
- if: '$CI_PIPELINE_SOURCE == "pipeline"' # multi-project pipeline
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule"' # scheduled run
|
||||
- if: '$CI_PIPELINE_SOURCE == "web"' # pipeline run from UI
|
||||
|
||||
stages:
|
||||
- build
|
||||
- release
|
||||
|
||||
.build:
|
||||
stage: build
|
||||
variables:
|
||||
IDIR: 'NOVA'
|
||||
HOST: 'x86_64'
|
||||
HGCC: '/opt/${HOST}-linux/bin/${HOST}-linux-g++'
|
||||
PRFX: '/opt/${ARCH}-linux/bin/${ARCH}-linux-'
|
||||
script:
|
||||
- ${PRFX}gcc --version
|
||||
- mkdir ${IDIR}
|
||||
- time make -s -j ${NJOBS} ARCH=${ARCH} INS_DIR=${IDIR} PREFIX_${ARCH}=${PRFX} HST_CC=${HGCC} install
|
||||
artifacts:
|
||||
paths:
|
||||
- ${IDIR}/
|
||||
|
||||
build-aarch64:
|
||||
extends: .build
|
||||
variables:
|
||||
ARCH: 'aarch64'
|
||||
|
||||
build-x86_64:
|
||||
extends: .build
|
||||
variables:
|
||||
ARCH: 'x86_64'
|
||||
|
||||
# Work around https://gitlab.com/gitlab-org/gitlab-runner/-/issues/6400
|
||||
release-version:
|
||||
stage: build
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^release-/' # push to release tag
|
||||
script:
|
||||
- echo NOVA_VERSION=${CI_COMMIT_TAG//release-/} > version.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: version.env
|
||||
|
||||
release:
|
||||
stage: release
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^release-/' # push to release tag
|
||||
script:
|
||||
- echo Releasing ${NOVA_VERSION}
|
||||
release:
|
||||
tag_name: $CI_COMMIT_TAG
|
||||
name: 'Release ${NOVA_VERSION}'
|
||||
description: 'NOVA Microhypervisor Release ${NOVA_VERSION}'
|
||||
dependencies:
|
||||
- release-version
|
|
@ -0,0 +1,4 @@
|
|||
# Rules defined later take precedence over rules defined earlier
|
||||
|
||||
# Default
|
||||
* udo@hypervisor.org
|
Loading…
Reference in New Issue