Skip to content

Commit

Permalink
Merge pull request #39 from PDLPorters/gha-ci
Browse files Browse the repository at this point in the history
Use shared GitHub Actions
  • Loading branch information
zmughal authored Dec 30, 2022
2 parents cbc03ff + 24d2cf1 commit 4c66540
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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: true
ci:
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
needs: notify
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
perl-version: ['5.12', '5.14', '5.20']
include:
- perl-version: '5.30'
os: ubuntu-latest
release-test: true
coverage: true
- perl-version: '5.30'
os: windows-latest
## No display on macOS runner.
#- perl-version: '5.30'
# os: macos-11
steps:
- uses: actions/checkout@v2
- name: 'ci-dist: target-setup-perl'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
target-setup-perl: true
perl-version: ${{ matrix.perl-version }}
- name: Install PDL dependencies
uses: PDLPorters/devops/github-actions/install-dep-pdl-dep@master
- name: Install Prima dependencies
uses: PDLPorters/devops/github-actions/install-dep-prima-dep@master
- name: Install PDL::Drawing::Prima from source
if: false # Only enable for unreleased fixes.
shell: bash
run: |
$MYPERL -S cpanm -n --installdeps PDL::Drawing::Prima
$MYPERL -S cpanm -n https://github.com/dk/PDL-Drawing-Prima.git
- name: 'ci-dist: target-all'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
target-setup-perl: false
target-install-dist-perl-deps: true
dist-perl-deps-configure: Module::Build
target-test-release-testing: true
target-test: true
test-enable-release-testing: ${{ matrix.release-test }}
test-enable-coverage: ${{ matrix.coverage }}
test-enable-graphical-display: true
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: true
needs: ${{ toJSON(needs) }}
21 changes: 21 additions & 0 deletions .github/workflows/issue-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: issue-notify

on:
issues:
types: [opened,assigned,closed,reopened]
issue_comment:
types: [created]
pull_request:
types: [closed,assigned,converted_to_draft,ready_for_review,review_requested]
pull_request_review:
types: [submitted]

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
2 changes: 1 addition & 1 deletion lib/PDL/Graphics/Prima/DataSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ sub guess_scaling_for {
my $lin_space = $lin_spaces->average;
my $lin_score = (($lin_spaces - $lin_space)**2)->sum / $lin_spaces->nelem;

my $log_spaces = $data(1:-1) / $data(0:-2);
my $log_spaces = $data->slice('1:-1') / $data(0:-2);
my $log_space = $log_spaces->average;
my $log_score = (($log_spaces - $log_space)**2)->sum / $log_spaces->nelem;

Expand Down
5 changes: 5 additions & 0 deletions t/300-size-spec.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
use strict;
use warnings;

### Mock parent for @ISA
package Prima::Drawable;

#####################################
package Prima::Widget; # mock class
#####################################

our @ISA = ('Prima::Drawable');

sub new { return bless {} }
sub height { 10 }
sub width { 20 }
Expand Down

0 comments on commit 4c66540

Please sign in to comment.