name: linux
on:
  push:
    branches:
      - '*'
    tags-ignore:
      - '*'
  pull_request:
jobs:
  perl:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        perl-version:
          - '5.16-buster'
          - '5.18-buster'
          - '5.20-buster'
          - '5.22-buster'
          - '5.30-bullseye'
          - '5.32-bullseye'
    container:
      image: perl:${{ matrix.perl-version }}
    steps:
      - uses: actions/checkout@v3
      - name: perl -V
        run: perl -V
      - name: Fix ExtUtils::MakeMaker (for Perl 5.16 and 5.18)
        run: cpanm -n App::cpanminus ExtUtils::MakeMaker
      - name: Install dependencies
        run: |
          apt-get update
          apt-get install -y ruby-sass
          cpanm -n --installdeps .
          cpanm -n CSS::Minifier::XS JavaScript::Minifier::XS
          cpanm -n Test::Pod Test::Pod::Coverage
      - name: Run tests
        run: prove -l t
        env:
          TEST_SASS: 1
          TEST_POD: 1
