Else mkinitfs fails: https://gitlab.postmarketos.org/postmarketOS/postmarketos-mkinitfs/-/jobs/1395713 to run x86_64 binary on aarch64 Part-of: https://gitlab.postmarketos.org/postmarketOS/postmarketos-mkinitfs/-/merge_requests/63 [ci:skip-build]: already built successfully in CI
144 lines
3.8 KiB
YAML
144 lines
3.8 KiB
YAML
---
|
|
|
|
# global settings
|
|
image: alpine:edge
|
|
|
|
variables:
|
|
GOFLAGS: "-buildvcs=false"
|
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mkinitfs-vendor-${CI_COMMIT_TAG}/${CI_COMMIT_TAG}"
|
|
CI_TRON_TEMPLATE_PROJECT: &ci-tron-template-project postmarketOS/ci-common
|
|
CI_TRON_JOB_TEMPLATE_PROJECT_URL: $CI_SERVER_URL/$CI_TRON_TEMPLATE_PROJECT
|
|
CI_TRON_JOB_TEMPLATE_COMMIT: &ci-tron-template-commit 7c95b5f2d53533e8722abf57c73e558168e811f3
|
|
|
|
include:
|
|
- project: *ci-tron-template-project
|
|
ref: *ci-tron-template-commit
|
|
file: '/ci-tron/common.yml'
|
|
|
|
stages:
|
|
- build
|
|
- hardware tests
|
|
- vendor
|
|
- release
|
|
|
|
workflow:
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
- if: $CI_COMMIT_BRANCH == 'master'
|
|
- if: '$CI_COMMIT_TAG != null'
|
|
|
|
build:
|
|
stage: build
|
|
variables:
|
|
GOTEST: "gotestsum --junitfile report.xml --format testname -- ./..."
|
|
parallel:
|
|
matrix:
|
|
- TAG: shared
|
|
- TAG: arm64
|
|
tags:
|
|
- $TAG
|
|
before_script:
|
|
- apk -q add go gotestsum staticcheck make scdoc
|
|
script:
|
|
- make test
|
|
- make
|
|
after_script:
|
|
- mkdir -p rootfs/usr/sbin
|
|
- cp mkinitfs rootfs/usr/sbin
|
|
artifacts:
|
|
expire_in: 1 week
|
|
reports:
|
|
junit: report.xml
|
|
paths:
|
|
- rootfs
|
|
|
|
.qemu-common:
|
|
variables:
|
|
DEVICE_NAME: qemu-$CPU_ARCH
|
|
KERNEL_VARIANT: lts
|
|
|
|
.build-ci-tron-qemu:
|
|
stage: hardware tests
|
|
extends:
|
|
- .pmos-ci-tron-build-boot-artifacts
|
|
- .qemu-common
|
|
variables:
|
|
INSTALL_PACKAGES: device-${DEVICE_NAME} device-${DEVICE_NAME}-kernel-${KERNEL_VARIANT} postmarketos-mkinitfs-hook-ci
|
|
|
|
build-ci-tron-qemu-amd64:
|
|
extends:
|
|
- .build-ci-tron-qemu
|
|
needs:
|
|
- job: "build"
|
|
parallel:
|
|
matrix:
|
|
- TAG: shared
|
|
variables:
|
|
CPU_ARCH: amd64
|
|
|
|
build-ci-tron-qemu-aarch64:
|
|
extends:
|
|
- .build-ci-tron-qemu
|
|
needs:
|
|
- job: "build"
|
|
parallel:
|
|
matrix:
|
|
- TAG: arm64
|
|
variables:
|
|
CPU_ARCH: aarch64
|
|
|
|
.test-ci-tron-qemu:
|
|
stage: hardware tests
|
|
extends:
|
|
- .pmos-ci-tron-initramfs-test
|
|
- .qemu-common
|
|
dependencies: []
|
|
variables:
|
|
CI_TRON_KERNEL__URL: "glartifact://build-ci-tron-qemu-$CPU_ARCH/${CI_TRON__PMB_EXPORT_PATH}/vmlinuz-${KERNEL_VARIANT}"
|
|
CI_TRON_INITRAMFS__INITRAMFS__URL: "glartifact://build-ci-tron-qemu-$CPU_ARCH/${CI_TRON__PMB_EXPORT_PATH}/initramfs"
|
|
CI_TRON_KERNEL_CMDLINE__DEVICEINFO: 'console=tty1 console=ttyS0,115200 PMOS_FORCE_PARTITION_RESIZE'
|
|
|
|
test-ci-tron-qemu-amd64:
|
|
extends:
|
|
- .test-ci-tron-qemu
|
|
- .pmos-ci-tron-runner-qemu-amd64
|
|
needs:
|
|
- job: 'build-ci-tron-qemu-amd64'
|
|
artifacts: false
|
|
variables:
|
|
CPU_ARCH: amd64
|
|
|
|
test-ci-tron-qemu-aarch64:
|
|
extends:
|
|
- .test-ci-tron-qemu
|
|
- .pmos-ci-tron-runner-qemu-aarch64
|
|
needs:
|
|
- job: 'build-ci-tron-qemu-aarch64'
|
|
artifacts: false
|
|
variables:
|
|
CPU_ARCH: aarch64
|
|
|
|
vendor:
|
|
stage: vendor
|
|
image: alpine:latest
|
|
rules:
|
|
- if: '$CI_COMMIT_TAG != null'
|
|
before_script:
|
|
- apk -q add curl go make
|
|
script:
|
|
- |
|
|
make VERSION="${CI_COMMIT_TAG}" vendor
|
|
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "mkinitfs-vendor-${CI_COMMIT_TAG}.tar.gz" "${PACKAGE_REGISTRY_URL}/"
|
|
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "mkinitfs-vendor-${CI_COMMIT_TAG}.tar.gz.sha512" "${PACKAGE_REGISTRY_URL}/"
|
|
|
|
release:
|
|
stage: release
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
rules:
|
|
- if: '$CI_COMMIT_TAG != null'
|
|
script:
|
|
- |
|
|
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
|
|
--assets-link "{\"name\":\"mkinitfs-vendor-${CI_COMMIT_TAG}.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/mkinitfs-vendor-${CI_COMMIT_TAG}.tar.gz\"}" \
|
|
--assets-link "{\"name\":\"mkinitfs-vendor-${CI_COMMIT_TAG}.tar.gz.sha512\",\"url\":\"${PACKAGE_REGISTRY_URL}/mkinitfs-vendor-${CI_COMMIT_TAG}.tar.gz.sha512\"}"
|