# This defines the full set of distros we run CI on.
---
platform_map:  # map packaging architectures to docker platforms
  aarch64: linux/arm64/v8
  amd64: linux/amd64
  arm64: linux/arm64/v8
  armhf: linux/arm/v7
  armhfp: linux/arm/v7
  i386: linux/i386
  x86_64: linux/amd64
arch_order:  # sort order for per-architecture jobs in CI
  - amd64
  - x86_64
  - i386
  - armhf
  - armhfp
  - arm64
  - aarch64
include:
  - &alpine
    distro: alpine
    version: edge
    eol_check: false
    env_prep: |
      apk add -U bash
    jsonc_removal: |
      apk del json-c-dev
    test:
      ebpf-core: true
  - <<: *alpine
    version: "3.17"
    eol_check: true
  - <<: *alpine
    version: "3.16"
    eol_check: true
  - <<: *alpine
    version: "3.15"
    eol_check: true

  - distro: archlinux
    version: latest
    eol_check: false
    env_prep: |
      pacman --noconfirm -Syu && pacman --noconfirm -Sy grep libffi
    test:
      ebpf-core: true

  - &alma
    distro: almalinux
    version: "9"
    jsonc_removal: |
      dnf remove -y json-c-devel
    eol_check: true
    packages: &alma_packages
      type: rpm
      repo_distro: el/9
      alt_links:
        - el/9Server
        - el/9Client
      arches:
        - x86_64
        - aarch64
    test:
      ebpf-core: true
  - <<: *alma
    version: "8"
    packages:
      <<: *alma_packages
      repo_distro: el/8
      alt_links:
        - el/8Server
        - el/8Client

  - &amzn
    distro: amazonlinux
    version: "2"
    eol_check: 'amazon-linux'
    packages: &amzn_packages
      type: rpm
      repo_distro: amazonlinux/2
      arches:
        - x86_64
        - aarch64
    test:
      ebpf-core: false
  - <<: *amzn
    version: "2023"
    packages:
      <<: *amzn_packages
      repo_distro: amazonlinux/2023


  - distro: centos
    version: "7"
    eol_check: false
    packages:
      type: rpm
      repo_distro: el/7
      alt_links:
        - el/7Server
        - el/7Client
      arches:
        - x86_64
    test:
      ebpf-core: false

  - &debian
    distro: debian
    version: "12"
    base_image: debian:bookworm
    eol_check: true
    env_prep: |
      apt-get update
    jsonc_removal: |
      apt-get purge -y libjson-c-dev
    packages: &debian_packages
      type: deb
      repo_distro: debian/bookworm
      arches:
        - i386
        - amd64
        - armhf
        - arm64
    test:
      ebpf-core: true
  - <<: *debian
    version: "11"
    base_image: debian:bullseye
    packages:
      <<: *debian_packages
      repo_distro: debian/bullseye
    test:
      ebpf-core: false
  - <<: *debian
    version: "10"
    base_image: debian:buster
    packages:
      <<: *debian_packages
      repo_distro: debian/buster
    test:
      ebpf-core: false

  - &fedora
    distro: fedora
    version: "38"
    eol_check: true
    jsonc_removal: |
      dnf remove -y json-c-devel
    packages: &fedora_packages
      type: rpm
      repo_distro: fedora/38
      arches:
        - x86_64
        - aarch64
    test:
      ebpf-core: true
  - <<: *fedora
    version: "37"
    packages:
      <<: *fedora_packages
      repo_distro: fedora/37
    test:
      ebpf-core: true
  - <<: *fedora
    version: "36"
    packages:
      <<: *fedora_packages
      repo_distro: fedora/36
    test:
      ebpf-core: true

  - &opensuse
    distro: opensuse
    version: "15.4"
    eol_check: true
    base_image: opensuse/leap:15.4
    jsonc_removal: |
      zypper rm -y libjson-c-devel
    packages: &opensuse_packages
      type: rpm
      repo_distro: opensuse/15.4
      arches:
        - x86_64
        - aarch64
    test:
      ebpf-core: true

  - &oracle
    distro: oraclelinux
    version: "8"
    eol_check: true
    jsonc_removal: |
      dnf remove -y json-c-devel
    packages: &oracle_packages
      type: rpm
      repo_distro: ol/8
      arches:
        - x86_64
        - aarch64
    test:
      ebpf-core: true
  - <<: *oracle
    version: "9"
    packages:
      <<: *oracle_packages
      repo_distro: ol/9

  - &ubuntu
    distro: ubuntu
    version: "22.10"
    eol_check: true
    env_prep: |
      rm -f /etc/apt/apt.conf.d/docker && apt-get update
    jsonc_removal: |
      apt-get remove -y libjson-c-dev
    packages: &ubuntu_packages
      type: deb
      repo_distro: ubuntu/kinetic
      arches:
        - amd64
        - armhf
        - arm64
    test:
      ebpf-core: true
  - <<: *ubuntu
    version: "23.04"
    packages:
      <<: *ubuntu_packages
      repo_distro: ubuntu/lunar
  - <<: *ubuntu
    version: "22.04"
    packages:
      <<: *ubuntu_packages
      repo_distro: ubuntu/jammy
  - <<: *ubuntu
    version: "20.04"
    packages:
      <<: *ubuntu_packages
      repo_distro: ubuntu/focal
