-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (65 loc) · 2.01 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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']
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.x' # 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: matrix.os == 'macos-latest'
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