name: build

on:
  push:
    branches-ignore:
      - "debian/**"
      - "dependabot/**"
      - "pristine-tar"
      - "ubuntu/**"
      - "upstream/**"
    tags:
      - "release/*"
  pull_request:
    branches:
      - main

jobs:
  perl:
    env:
      AUTHOR_TESTING: 1

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        perl-version:
          - "5.38"
          - "5.36"
          - "5.34"
          - "5.32"
          - "5.30"
          - "5.28"
          - "5.26"
          - "5.24"

    container:
      image: perldocker/perl-tester:${{ matrix.perl-version }}

    steps:
      - uses: actions/checkout@v4
      - name: Install pandoc
        run: apt-get -y --no-install-recommends install pandoc
      - uses: perl-actions/install-with-cpm@v1.9
        with:
          cpanfile: "cpanfile"
          args: "--with-suggests"
          sudo: false
      - name: Build.PL
        run: perl Build.PL
      - name: make test
        run: ./Build test
