{"id":15557681,"url":"https://github.com/fgasper/perl-github-action-tips","last_synced_at":"2025-10-06T16:10:36.193Z","repository":{"id":43329720,"uuid":"466166523","full_name":"FGasper/perl-github-action-tips","owner":"FGasper","description":"Tips for testing Perl modules via GitHub Actions","archived":false,"fork":false,"pushed_at":"2022-12-06T13:54:20.000Z","size":37,"stargazers_count":29,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T03:46:25.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FGasper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-04T15:04:47.000Z","updated_at":"2024-02-05T03:24:42.000Z","dependencies_parsed_at":"2023-01-24T01:45:47.567Z","dependency_job_id":null,"html_url":"https://github.com/FGasper/perl-github-action-tips","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fperl-github-action-tips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fperl-github-action-tips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fperl-github-action-tips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fperl-github-action-tips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FGasper","download_url":"https://codeload.github.com/FGasper/perl-github-action-tips/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183065,"owners_count":21226140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T15:20:20.057Z","updated_at":"2025-10-06T16:10:36.077Z","avatar_url":"https://github.com/FGasper.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"It’s easy to test Perl modules in various scenarios via GitHub Actions!\n\nSee below …\n\n# Linux, standard builds\n\n```\n  linux:\n    runs-on: ubuntu-latest\n\n    strategy:\n      fail-fast: false\n      matrix:\n        perl-version:\n          - '5.36'\n          - '5.34'\n          - '5.32'\n          - '5.30'\n          - '5.28'\n          - '5.26'\n          - '5.24'\n          - '5.22'\n          - '5.20'\n          - '5.18'\n          - '5.16'\n          - '5.14'\n          - '5.12'\n          - '5.10'\n\n    container:\n      image: perldocker/perl-tester:${{ matrix.perl-version }}\n\n    steps:\n      - uses: actions/checkout@main\n        with:\n            submodules: recursive\n      - run: perl -V\n      - run: cpanm --notest --installdeps --verbose .\n      - run: perl Makefile.PL\n      - run: make\n      - run: prove -wlvmb t\n```\nAssuming your module only depends on CPAN modules, the above will test it against all standard perls from 5.10 to 5.36.\n\n## External Dependencies\n\nAt some point early in your `steps`, add `apt install -y ...`, where `...` is your list of apt packages to install.\n\n## Coverage Testing via [Coveralls](https://coveralls.io)\n\nUnder `matrix`, include this:\n```\n        include:\n          - perl-version: '5.32'   # or whichever version you want to scope this to\n            os: ubuntu-latest\n            coverage: true\n```\n… then, instead of the `prove` line in the original `steps`, do:\n```\n      - name: Run Tests (no coverage)\n        if: ${{ !matrix.coverage }}\n        run: make test\n      - name: Run tests (with coverage)\n        if: ${{ matrix.coverage }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: |\n          cpanm -n Devel::Cover::Report::Coveralls\n          cover -test -report Coveralls\n```\nThen, ensure that Coveralls is set up to receive coverage reports from your repository.\n\n# macOS\n\nEven easier than Linux:\n```\n  macOS:\n    runs-on: macOS-latest\n```\n… then the same `steps` as above.\n\n## External Dependencies\n\n`brew install ...` where on Linux you did `apt`.\n\n# Windows\n\nAs easy as macOS:\n```\n  windows:\n    runs-on: windows-latest\n```\n\n## External Dependencies\n\nUse [Chocolatey](https://chocolatey.org/); however, I’ve not gotten this to work for, e.g., linking XS modules against other C libraries.\n\n# Linux, Big-Endian\n\nThe magic of [QEMU](https://qemu.org) makes this possible …\n\n```\n  big-endian:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Get the qemu container\n        run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes\n      - name: Run tests on s390x/ubuntu\n        run: docker run --rm --interactive s390x/ubuntu bash -c \"apt update; apt install -y git cpanminus make; git clone --recurse-submodules $GITHUB_SERVER_URL/$GITHUB_REPOSITORY; cd $( echo $GITHUB_REPOSITORY | cut -d/ -f2 ); cpanm --notest --installdeps --verbose .; perl Makefile.PL; make; prove -wlvmb t\"\n```\n\n# Linux, 32-bit\n\nJust tweak the big-endian example above to say `arm32v7` rather than `s390x`.\n\n# Linux, [musl libc](https://musl.libc.org)\n\nSometimes it’s useful to test against “alternative” libc implementations. [Alpine Linux](https://www.alpinelinux.org/) has you covered:\n\n```\n  musl:\n    runs-on: ubuntu-latest\n    \n    container:\n      image: alpine\n      \n    steps:\n      - run: apk add perl-app-cpanminus\n      # ...\n```\n\n# Linux, long-double \u0026 quadmath\n\nVia [unofficial builds courtesy of simcop2387](https://hub.docker.com/r/simcop2387/perl-tester/tags):\n```\n  linux-alt-perl:\n    runs-on: ubuntu-latest\n\n    strategy:\n      fail-fast: false\n      matrix:\n        perl-version:\n          - '5.020.003-main-longdouble-buster'\n          - '5.020.003-main-quadmath-buster'\n\n    container:\n      image: simcop2387/perl-tester:${{ matrix.perl-version }}\n\n    steps:\n```\n… with the same `steps` you usually do.\n\nCheck [simcop2387’s perl containers](https://hub.docker.com/r/simcop2387/perl/tags) for possible values of `perl-version`.\n\n# Cygwin\n\n```\n  cygwin:\n    runs-on: windows-latest\n\n    steps:\n      - name: Set up Cygwin\n        uses: cygwin/cygwin-install-action@master\n        with:\n            packages: perl_base perl-ExtUtils-MakeMaker make gcc-g++ libcrypt-devel libnsl-devel bash\n      - uses: actions/checkout@main\n        with:\n          submodules: recursive\n      - shell: C:\\cygwin\\bin\\bash.exe --login --norc -eo pipefail -o igncr '{0}'\n        run: |\n            perl -V\n            cpan -T App::cpanminus\n            cd $GITHUB_WORKSPACE\n            cpanm --verbose --notest --installdeps --with-configure --with-develop .\n            perl Makefile.PL\n            make test\n```\n\nNote the `with`.`packages`; see Cygwin’s package repository for names of available packages. (Unlike plain Windows, this _does_ work seamlessly to text XS modules’ integrations with external C libraries.)\n\n# FreeBSD \u0026 OpenBSD\n\n```\n  BSDs:\n    runs-on: macos-latest\n  \n    strategy:\n      fail-fast: false\n      matrix:\n        os:\n          - name: freebsd\n            version: '13.0'\n            pkginstall: pkg install -y p5-ExtUtils-MakeMaker\n          - name: openbsd\n            version: '7.1'\n            pkginstall: pkg_add p5-ExtUtils-MakeMaker\n\n    steps:\n      - uses: actions/checkout@main\n        with:\n          submodules: recursive\n      - name: Test on ${{ matrix.os.name }}\n        uses: cross-platform-actions/action@master\n        with:\n          operating_system: ${{ matrix.os.name }}\n          version: ${{ matrix.os.version }}\n          shell: bash\n          run: |\n            sudo ${{ matrix.os.pkginstall }}\n            curl -L https://cpanmin.us | sudo perl - --verbose --notest --installdeps --with-configure --with-develop .\n            perl Makefile.PL\n            make\n            prove -wlvmb t\n\n```\nNote the `pkginstall` option to install any external dependencies; it may not be needed for your case.\n\nAlso, FreeBSD does have a `p5-App-cpanminus` port, but OpenBSD has no such port.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgasper%2Fperl-github-action-tips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgasper%2Fperl-github-action-tips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgasper%2Fperl-github-action-tips/lists"}