Some of the build-dependencies that were installed from Debian Unstable as a workaround, are not available anymore. Until that issue has been solved properly, allow the `build_deb`-CI-job to fail, so that merge-requests can still be merged. Part-of: <https://gitlab.gnome.org/World/Phosh/squeekboard/-/merge_requests/653>
		
			
				
	
	
		
			156 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			156 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
image: debian:trixie
 | 
						|
 | 
						|
variables:
 | 
						|
  DEBIAN_FRONTEND: noninteractive
 | 
						|
 | 
						|
default:
 | 
						|
  # Protect CI infra from rogue jobs
 | 
						|
  timeout: 15 minutes
 | 
						|
  # Allow jobs to be caneled on new commits
 | 
						|
  interruptible: true
 | 
						|
  # Retry on infra hickups automatically
 | 
						|
  retry:
 | 
						|
    max: 1
 | 
						|
    when:
 | 
						|
      - api_failure
 | 
						|
      - runner_system_failure
 | 
						|
      - scheduler_failure
 | 
						|
      - stuck_or_timeout_failure
 | 
						|
 | 
						|
stages:
 | 
						|
  - build
 | 
						|
  - test
 | 
						|
  - deploy
 | 
						|
 | 
						|
before_script:
 | 
						|
# Workaround for unavailable dependencies
 | 
						|
  - mv debian/control.debian-testing debian/control
 | 
						|
# End of workaround for unavailable dependencies
 | 
						|
  - apt-get -y update
 | 
						|
  - apt-get -y install ca-certificates
 | 
						|
 | 
						|
build_docs:
 | 
						|
  stage: build
 | 
						|
  artifacts:
 | 
						|
    paths:
 | 
						|
      - _build
 | 
						|
  script:
 | 
						|
    - apt-get -y install --no-install-recommends python3-pip python3-sphinx python3-recommonmark
 | 
						|
    - ./doc/build.sh _build
 | 
						|
  except:
 | 
						|
    variables:
 | 
						|
      - $PKG_ONLY == "1"
 | 
						|
 | 
						|
build_meson:
 | 
						|
  stage: build
 | 
						|
  artifacts:
 | 
						|
    paths:
 | 
						|
      - _build
 | 
						|
    expire_in: 3h
 | 
						|
  script:
 | 
						|
    - apt-get -y build-dep .
 | 
						|
    - meson . _build/ -Ddepdatadir=/usr/share -Dfind_orphans=true --werror
 | 
						|
    - ninja -C _build install
 | 
						|
  except:
 | 
						|
    variables:
 | 
						|
      - $PKG_ONLY == "1"
 | 
						|
 | 
						|
build_deb:
 | 
						|
  allow_failure: true
 | 
						|
  tags:
 | 
						|
    - aarch64
 | 
						|
  stage: build
 | 
						|
  artifacts:
 | 
						|
    paths:
 | 
						|
      - '*.deb'
 | 
						|
  script:
 | 
						|
    - rm -f ../*.deb
 | 
						|
# Workaround for unavailable dependencies
 | 
						|
# TODO: Port Squeekboard to GTK4/GTK4-layer-shell
 | 
						|
# https://gitlab.gnome.org/World/Phosh/squeekboard/-/issues/64
 | 
						|
    - echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
 | 
						|
    - echo "deb http://deb.debian.org/debian/ experimental main" > /etc/apt/sources.list.d/experimental.list
 | 
						|
    - echo "APT::Default-Release \"trixie\";" > /etc/apt/apt.conf.d/default-release
 | 
						|
    - apt-get -y update
 | 
						|
    - apt-get -y --no-upgrade install librust-gio-dev librust-glib-dev librust-glib-sys-dev
 | 
						|
      librust-gtk-dev librust-gtk-sys-dev
 | 
						|
    - apt-get -y --no-upgrade install -t experimental librust-serde-yaml-dev
 | 
						|
# End of workaround for unavailable dependencies
 | 
						|
    - apt-get -y build-dep .
 | 
						|
    - apt-get -y install devscripts
 | 
						|
    - REV=$(git log -1 --format=%h)
 | 
						|
    - VER=$(dpkg-parsechangelog -SVersion)
 | 
						|
    - DEBFULLNAME="Librem5 CI"
 | 
						|
    - EMAIL="librem5-builds@lists.community.puri.sm"
 | 
						|
    - dch -v"$VER+librem5ci$CI_PIPELINE_ID.$REV" "$MSG"
 | 
						|
    - debuild -i -us -uc -b
 | 
						|
    - cp ../*.deb .
 | 
						|
 | 
						|
build_reference:
 | 
						|
  stage: build
 | 
						|
  needs:
 | 
						|
    - job: build_meson
 | 
						|
      artifacts: true
 | 
						|
  artifacts:
 | 
						|
    paths:
 | 
						|
      - _build/doc
 | 
						|
  script:
 | 
						|
    - apt-get -y build-dep .
 | 
						|
    - apt-get -y install cargo
 | 
						|
    - cd _build
 | 
						|
    - ../cargo.sh doc --no-deps --document-private-items --features 'zbus_v1_5,clap_v4'
 | 
						|
  except:
 | 
						|
    variables:
 | 
						|
      - $PKG_ONLY == "1"
 | 
						|
 | 
						|
test:
 | 
						|
  stage: test
 | 
						|
  needs:
 | 
						|
    - job: build_meson
 | 
						|
      artifacts: true
 | 
						|
  script:
 | 
						|
    - apt-get -y build-dep .
 | 
						|
    - apt-get -y install clang-tidy
 | 
						|
    - ninja -C _build test
 | 
						|
    - tools/style-check_build _build
 | 
						|
  except:
 | 
						|
    variables:
 | 
						|
      - $PKG_ONLY == "1"
 | 
						|
 | 
						|
test_style:
 | 
						|
  stage: test
 | 
						|
  needs: []
 | 
						|
  script:
 | 
						|
    - apt-get -y build-dep .
 | 
						|
    - tools/style-check_source
 | 
						|
  except:
 | 
						|
    variables:
 | 
						|
      - $PKG_ONLY == "1"
 | 
						|
 | 
						|
check_release:
 | 
						|
  stage: test
 | 
						|
  needs: []
 | 
						|
  only:
 | 
						|
    refs:
 | 
						|
      - main
 | 
						|
  script:
 | 
						|
    - apt-get -y install git python3
 | 
						|
    - (head -n 1 ./debian/changelog && git tag) | ./debian/check_release.py
 | 
						|
  except:
 | 
						|
    variables:
 | 
						|
      - $PKG_ONLY == "1"
 | 
						|
 | 
						|
pages:
 | 
						|
  stage: deploy
 | 
						|
  needs:
 | 
						|
    - build_docs
 | 
						|
    - build_reference
 | 
						|
  script:
 | 
						|
    - mv _build/ public/
 | 
						|
  artifacts:
 | 
						|
    paths:
 | 
						|
      - public
 | 
						|
  only:
 | 
						|
    refs:
 | 
						|
      - main
 |