Build and test #69
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
name: Build and test | |
on: | |
workflow_dispatch | |
# Uncomment or modify these lines according to your needs | |
# push: | |
# branches: 'main' | |
# pull_request: | |
# branches: '*' | |
# schedule: | |
# - cron: '42 5 * * 0' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-latest', 'macos-latest'] | |
#os: ['ubuntu-latest', 'macos-14'] | |
perl: ['5.34', '5.32', '5.30', '5.28', '5.26'] | |
name: Perl ${{ matrix.perl }} on ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' # Specify your Python version here | |
- name: Install dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libzbar0 | |
- name: Install dependencies on macOS | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install zbar | |
mkdir ~/lib | |
ln -s $(brew --prefix zbar)/lib/libzbar.dylib ~/lib/libzbar.dylib | |
- name: Create and activate virtual environment | |
run: | | |
python -m venv venv | |
- name: Install Python dependencies | |
run: | | |
source venv/bin/activate | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Set up Perl | |
uses: shogo82148/actions-setup-perl@v1 | |
with: | |
perl-version: ${{ matrix.perl }} | |
- run: perl -V | |
- name: Install Perl dependencies | |
run: | | |
source venv/bin/activate | |
cpanm -n --installdeps . | |
- name: Execute Perl tests | |
run: | | |
source venv/bin/activate | |
prove -l t | |
- name: Run tests (with coverage) | |
if: ${{ matrix.perl == '5.30' && matrix.os == 'ubuntu-latest' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
source venv/bin/activate | |
perl Makefile.PL | |
cpanm -n Devel::Cover::Report::Coveralls | |
cover -test -report Coveralls |