Skip to content

Commit

Permalink
Merge a0cf2f9 into 1a2e9f7
Browse files Browse the repository at this point in the history
  • Loading branch information
zmughal committed Sep 27, 2021
2 parents 1a2e9f7 + a0cf2f9 commit 93c0f7b
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: perl
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
create:
jobs:
notify:
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ always() }}
steps:
- uses: PDLPorters/devops/github-actions/irc-notifications@master
with:
target-notifications: false # TODO
dist:
name: Make distribution using Dist::Zilla
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: 'build-dzil-dist'
uses: PDLPorters/devops/github-actions/build-dzil-dist@master
ci:
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
needs: [ notify, dist ]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
perl-version: ['5.10', '5.14', '5.20', '5.30']
alien-install-type: [ 'system' ]
include:
- perl-version: '5.30'
os: ubuntu-latest
release-test: true
coverage: true
alien-install-type: 'share'
# Automatically set ALIEN_INSTALL_TYPE=share
# because no system install on Windows.
- perl-version: '5.30'
os: windows-latest
- perl-version: '5.30'
os: macos-latest
alien-install-type: 'system'
- perl-version: '5.30'
os: macos-latest
alien-install-type: 'share'
steps:
- uses: actions/checkout@v2
- name: Get dist artifact
uses: actions/download-artifact@v2
with:
name: dist
path: build-dir
- name: 'ci-dist: target-setup-perl'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
path: build-dir
target-setup-perl: true
perl-version: ${{ matrix.perl-version }}
- name: Install PLplot (system)
if: ${{ matrix.alien-install-type == 'system' }}
uses: PDLPorters/devops/github-actions/install-dep-plplot@master
- name: 'ci-dist: target-install-dist-perl-deps'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
path: build-dir
target-setup-perl: false
target-install-dist-perl-deps: true
- name: Install Perl optional deps
shell: bash
run: |
# test dep
if ${{ toJSON( runner.os != 'Windows' ) }}; then
cpanm -n FFI::Platypus
fi
- name: Set ALIEN_INSTALL_TYPE
shell: bash
run: |
echo "ALIEN_INSTALL_TYPE=${{ matrix.alien-install-type }}" >> $GITHUB_ENV
- name: 'ci-dist: target-all after install-dist-perl-deps'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
path: build-dir
target-setup-perl: false
target-install-dist-perl-deps: false
target-test-release-testing: true
target-test: true
test-enable-release-testing: ${{ matrix.release-test }}
test-enable-coverage: ${{ matrix.coverage }}
github-token: ${{ secrets.GITHUB_TOKEN }}

build-status:
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ always() }}
needs: [ 'ci' ]
steps:
- uses: PDLPorters/devops/github-actions/irc-notifications@master
with:
target-build-status: false # TODO
needs: ${{ toJSON(needs) }}
17 changes: 17 additions & 0 deletions .github/workflows/issue-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: issue-notify

on:
issues:
types: [opened]
issue_comment:
types: [created]

jobs:
notify:
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ always() }}
steps:
- uses: PDLPorters/devops/github-actions/irc-notifications@master
with:
target-notifications: true
5 changes: 5 additions & 0 deletions alienfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use alienfile;
plugin PkgConfig => 'plplot';

share {
requires 'File::Which';
# NOTE currently only pulling PLplot 5.15.0
start_url 'https://sourceforge.net/projects/plplot/files/plplot/5.15.0%20Source/';
plugin 'Decode::SourceForge';
Expand Down Expand Up @@ -36,6 +37,10 @@ share {
-DPLPLOT_USE_QT5=OFF
-DPL_DOUBLE=ON
),
( $^O eq 'MSWin32'
? ( '-DPKG_CONFIG_EXECUTABLE=' . File::Which::which('pkg-config'), )
: ()
),
@{ meta->prop->{plugin_build_cmake}->{args} },
'%{.install.extract}'
],
Expand Down
3 changes: 3 additions & 0 deletions lib/Alien/PLplot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package Alien::PLplot;
use strict;
use warnings;
use base qw( Alien::Base );
use Role::Tiny::With qw( with );
use 5.008004;

with 'Alien::Role::Dino';

1;
__END__
# ABSTRACT: Alien package for the PLplot plotting library
Expand Down
11 changes: 11 additions & 0 deletions t/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@ use Test::Alien;
use Test::Alien::Diag;
use Alien::PLplot;

use DynaLoader;

alien_diag 'Alien::PLplot';
alien_ok 'Alien::PLplot';

if( Alien::PLplot->install_type('share') ) {
unshift @DynaLoader::dl_library_path, Alien::PLplot->rpath;
# load shared object dependencies
for my $lib ( qw(-lcsirocsa -lqsastime) ) {
my @files = DynaLoader::dl_findfile($lib);
DynaLoader::dl_load_file($files[0]) if @files;
}
}

ffi_ok { symbols => ['c_plgver'] }, with_subtest {
my ($ffi) = @_;
eval q{
Expand Down

0 comments on commit 93c0f7b

Please sign in to comment.