Test of running pre-commit via github actions/workflow (#14) #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pagerduty2zabbix github Actions is copied from: | |
# https://github.com/perltidy/perltidy/blob/master/.github/workflows/perltest.yml | |
name: perlcompile | |
# This workflow will be triggered... | |
# on push to master branch | |
# when a pull request arrives to the master branch. (The source branch does not matter) | |
# workflow_dispatch to trigger manually or via API call | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
# There is a single job here called "build" (The word "build" is NOT a keyword, you can use anything there) | |
jobs: | |
build: | |
# This creates two dimensions: | |
# One will be called "os" with the list of the names of the 3 runners of GitHub Actions | |
# The other indicates version numbers of perl | |
# The words "os" and "perl" are free text here, they are like variable names. | |
# GitHub Action will run the job on 3x2 = 6 different setups | |
strategy: | |
matrix: | |
os: ['ubuntu-latest'] | |
perl: [ '5.10', '5.32', 'latest' ] | |
# Using the value from the matrix above we select the platform (operating system) to run on | |
runs-on: ${{ matrix.os }} | |
# Just a free-text name to be descriptive | |
name: Perl ${{ matrix.perl }} on ${{ matrix.os }} | |
# we will have several steps | |
steps: | |
# check out the current repository to the runner | |
# This setp did not get a nice "name" | |
- uses: actions/checkout@v2 | |
# Using the action from this repository: https://github.com/shogo82148/actions-setup-perl/ | |
# Will set up the desired version of perl on the current OS. | |
- name: Set up perl | |
uses: shogo82148/actions-setup-perl@v1 | |
with: | |
perl-version: ${{ matrix.perl }} | |
# display the version of perl - just for possible manual verification | |
- run: perl -V | |
# Install a specific version of Test::Deep when testing with perl 5.10.0 | |
- run: perl -e 'use 5.12.0;' || cpanm --install Test::[email protected] | |
# Requirement that gets an incompatible version on perl5.10 compilation tests | |
- run: perl -e 'use 5.011;' || cpanm --install IO::Socket::[email protected] | |
# Install the dependencies declared by the module ... | |
- run: cpanm --installdeps --skip-satisfied . | |
# Verify it compiles: | |
- run: perl -c pd2zabbix.cgi |