swh:1:snp:6a171e5d8397eb3fd44b0e1dacb73d80daf8046e
Raw File
Tip revision: 6149054e73c0f136c9e62697c2246e5d7886bf16 authored by Jens Finkhaeuser on 01 July 2022, 08:03:35 UTC
Windows' bounds checking on STL containers is (deservedly) strict, so let's not subscript a vector unless we know we can
Tip revision: 6149054
.woodpecker.yml
###############################################################################
# DEFINITIONS
##############################################################################

host_image: &host_image "nativeci/cpp-meson:latest"
ndk_image: &ndk_image "nativeci/android-ndk:latest"

##############################################################################
# MATRIX
##############################################################################
matrix:
  include:
  # Linux/compilers
  - CC: gcc
    CXX: g++
    IMAGE: *host_image
    ANALYSIS: true
  - CC: clang
    CXX: clang++
    IMAGE: *host_image

  # Android
  - TARGET_TYPE: cross
    IMAGE: *ndk_image
    MESON_EXTRA_ARGS: --cross-file android-arm64-v8a.txt
  - TARGET_TYPE: cross
    IMAGE: *ndk_image
    MESON_EXTRA_ARGS: --cross-file android-x86_64.txt
# See https://github.com/mesonbuild/wrapdb/issues/427
#  - TARGET_TYPE: cross
#    IMAGE: *ndk_image
#    MESON_EXTRA_ARGS: --cross-file android-armeabi-v7a.txt
# See https://github.com/mesonbuild/wrapdb/issues/428
#  - TARGET_TYPE: cross
#    IMAGE: *ndk_image
#    MESON_EXTRA_ARGS: --cross-file android-x86.txt

##############################################################################
# PIPELINE
##############################################################################

pipeline:
  ############################################################################
  # Dependencies

  deps:
    image: ${IMAGE}
    environment:
    - PIPENV_VENV_IN_PROJECT=1
    commands:
    - CI=true pipenv install --ignore-pipfile

  ############################################################################
  # Build

  build:
    image: ${IMAGE}
    commands:
    - mkdir build && cd build
    - meson .. -Db_coverage=${ANALYSIS:=false} ${MESON_EXTRA_ARGS}
    - ninja -v

  appveyor:
    image: ${IMAGE}
    commands:
    - CI=true pipenv run python ./scripts/appveyor.py
    secrets:
    - APPVEYOR_TOKEN
    when:
      matrix:
        CC: gcc
        IMAGE: *host_image
        ANALYSIS: true

  ############################################################################
  # Tests

  test:
    image: ${IMAGE}
    commands:
    - cd build
    - if /usr/bin/test ${TARGET_TYPE:=host} == host ; then
        ./test/unittests ;
      else
        echo "Test skipped for cross-compiled targets." ;
      fi

  ############################################################################
  # Analysis & Checks

  towncrier:
    image: ${IMAGE}
    commands:
    - git fetch origin main
    - CI=true pipenv run towncrier check --compare-with origin/main
    when:
      event:
      - pull_request
      matrix:
        CC: gcc
        IMAGE: *host_image
        ANALYSIS: true

  semgrep:
    image: ${IMAGE}
    group: analysis
    commands:
    - CI=true pipenv run semgrep ci --config auto
    when:
      event:
      - pull_request
      matrix:
        CC: gcc
        IMAGE: *host_image
        ANALYSIS: true

  flawfinder:
    image: ${IMAGE}
    group: analysis
    commands:
    - CI=true pipenv run flawfinder include/ lib/ examples/
    when:
      event:
      - pull_request
      matrix:
        CC: gcc
        IMAGE: *host_image
        ANALYSIS: true

  coverage:
    image: ${IMAGE}
    group: analysis
    commands:
    - cd build
    - if /usr/bin/test ${TARGET_TYPE:=host} == host ; then
        ninja coverage
        && cat meson-logs/coverage.txt ;
      fi
    when:
      event:
      - pull_request
      matrix:
        CC: gcc
        IMAGE: *host_image
        ANALYSIS: true
back to top