pdns-cli 0.0.2

Rust client library and CLI for the PowerDNS Authoritative Server API
Documentation
# You can override the included template(s) by including variable overrides
#
# SAST customization:
# https://docs.gitlab.com/user/application_security/sast/#available-cicd-variables
#
# Secret Detection customization:
# https://docs.gitlab.com/user/application_security/secret_detection/pipeline/configure/
#
# Dependency Scanning customization:
# https://docs.gitlab.com/user/application_security/dependency_scanning_sbom/#customizing-analyzer-behavior
#
# Container Scanning customization:
# https://docs.gitlab.com/user/application_security/container_scanning/#customizing-analyzer-behavior
#
# Note that environment variables can be set in several places.
#
# See:
# https://docs.gitlab.com/ci/variables/#cicd-variable-precedence


#############################
# Pipeline stages
#############################
#
# Stages execute sequentially.
# Jobs within the same stage can run in parallel.

stages:
  - rust
  - security


#############################
# Global CI image
#############################
#
# Use the same Rust version as rust-toolchain.toml.

image: rust:1.96


#############################
# Global variables
#############################

variables:

  # Store Cargo downloaded dependencies inside
  # the project directory so GitLab can cache them.
  CARGO_HOME: "$CI_PROJECT_DIR/.cargo"

  # Enable GitLab secret scanning.
  SECRET_DETECTION_ENABLED: "true"


#############################
# Cargo cache
#############################
#
# Cache dependencies and build artifacts between
# pipeline runs to make CI faster.

cache:
  key:
    files:
      - Cargo.lock
  paths:
    - .cargo/
    - target/


#############################
# Rust formatting
#############################
#
# Ensures code is formatted using rustfmt.

rust_fmt:
  stage: rust

  script:
    - cargo fmt --all --check


#############################
# Rust linting
#############################
#
# Runs clippy with every enabled feature.

rust_clippy:
  stage: rust

  script:
    - rustup component add clippy
    - cargo clippy --all-targets --all-features


#############################
# Rust compile check
#############################
#
# Checks that the crate compiles with all features.

rust_check:
  stage: rust

  script:
    - cargo check --all-features


#############################
# Rust tests
#############################
#
# Runs unit and integration tests with all features.

rust_tests:
  stage: rust

  script:
    - cargo test --all-features

#############################
# Rust doc
#############################
#
# Runs rustdoc to catch rustdoc lint errors

rust_docs:
  stage: rust

  script:
    - cargo doc --no-deps

#############################
# Rust unused dep detection
#############################
#
# Runs cargo-shear to catch unused dependencies
# these can often give false positives: thus allowed to fail

cargo-shear:
  stage: rust
  script:
    - cargo install cargo-shear
    - cargo shear
  allow_failure: true


#############################
# GitLab Security Templates
#############################
#
# These templates add GitLab-managed security jobs.

include:
  - template: Security/SAST.gitlab-ci.yml
  - template: Security/Secret-Detection.gitlab-ci.yml


#############################
# Static Application Security Testing
#############################
#
# Scans the repository for security issues.

sast:
  stage: security


#############################
# Secret Detection
#############################
#
# Detects accidentally committed secrets,
# such as API keys or credentials.

secret_detection:
  stage: security