Commit 5e5a13d7 authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Merge branch 'feat/prometheus-tests' into 'main'

Feat: CI: tests for prometheus; sort jobs by stage

See merge request !90
parents 5d521b35 aeec4ede
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ include:
    file: .gitlab-ci-base.yml

pages:
  stage: build
  extends: .onion-mkdocs-clone
  after_script:
    - $ONION_MKDOCS_LOCATION/scripts/onion-mkdocs-provision-build
+1 −0
Original line number Diff line number Diff line
slides:
  image: debian:bookworm
  stage: build
  script:
    - apt-get update
    - apt-get install -y git
+44 −0
Original line number Diff line number Diff line
@@ -3,7 +3,12 @@ include:
  - local: '.gitlab-ci-pages.yml'
  - local: '.gitlab-ci-slides.yml'

#
# Python
#

python:
  stage: build
  image: debian:bookworm
  script:
    - apt-get update
@@ -19,7 +24,12 @@ python:
  #only:
  #  - main

#
# Debian
#

debian:
  stage: build
  # Using bookworm support due to the pybuild-plugin-pyproject package
  #image: debian:bookworm
  #image: debian:bookworm-backports
@@ -42,8 +52,13 @@ debian:
  #only:
  #  - main

#
# Configuration
#

configs:
  image: debian:bookworm
  stage: build
  script:
    - apt-get update
    - apt-get install -y git
@@ -59,8 +74,13 @@ configs:
  #only:
  #  - main

#
# Documentation
#

#manpage:
#  image: debian:bookworm
#  stage: build
#  script:
#    - apt-get update
#    - apt-get install -y git
@@ -76,6 +96,30 @@ configs:
#  only:
#    - main

#
# Prometheus
# Thanks https://gitlab.torproject.org/tpo/tpa/prometheus-alerts
#

pint:
  stage: test
  image: ghcr.io/cloudflare/pint
  script:
    - pint lint configs/prometheus/*rules*

promtool:
  stage: test
  image:
    name: quay.io/prometheus/prometheus
    entrypoint: [""]
  script:
    - promtool check config configs/prometheus/prometheus.yml
    - promtool test rules configs/prometheus/test.yml

#
# Release
#

release:
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  stage: .post
+22 −0
Original line number Diff line number Diff line
---
# Sample Prometheus test rule file to be used with Docker Compose.
#
# Copyright (C) 2025 The Tor Project, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# This program 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 for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

rule_files:
  - prometeus-rules.yml

tests: