name: CI

on:
  push:
    branches:
      - develop
      - master
      - 'release/**'

  pull_request:
    branches:
      - develop
      - master
      - 'release/**'

env:
  TEST_WITH_NETWORK: 1

jobs:
  run-tests:
    strategy:
      fail-fast: false 
      matrix:
        perl:
          - '5.40'
          - '5.36'
          - '5.26'
        runner:
          - ubuntu-22.04

    runs-on: ${{ matrix.runner }}

    steps:
      - uses: actions/checkout@v4

      - uses: shogo82148/actions-setup-perl@v1
        with:
          perl-version: ${{ matrix.perl }}

      - name: perl version
        run: perl -v

      - name: apt install
        run: sudo apt install -y libidn2-dev

      - name: cpan module
        run: cpanm Devel::CheckLib ExtUtils::PkgConfig Module::Install Module::Install::XSUtil Test::Exception Test::Fatal 

      - name: installation
        run: cpanm --verbose --notest --configure-args="--no-ed25519" .

      - name: test
        run: prove -bl

