Skip to content

Commit

Permalink
Latest workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed May 28, 2023
1 parent 28e9008 commit 7e270cb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/linux.yml
@@ -1,5 +1,5 @@
# brian's standard GitHub Actions Ubuntu config for Perl 5 modules
# version 20220902.001
# version 20230508.001
# https://github.com/briandfoy/github_workflows
# https://github.com/features/actions
# This file is licensed under the Artistic License 2.0
Expand Down Expand Up @@ -68,14 +68,13 @@ jobs:
- name: Install cpanm and multiple modules
run: |
curl -L https://cpanmin.us | perl - App::cpanminus
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny
cpan -M https://www.cpan.org -T ExtUtils::MakeMaker Test::Manifest
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny ExtUtils::MakeMaker Test::Manifest Test::More
# Install the dependencies, again not testing them. This installs the
# module in the current directory, so we end up installing the module,
# but that's not a big deal.
- name: Install dependencies
run: |
cpan -M https://www.cpan.org -T .
cpanm --notest --installdeps .
- name: Run tests
run: |
perl Makefile.PL
Expand All @@ -84,7 +83,7 @@ jobs:
- name: Author tests
if: hashFiles('xt') != ''
run: |
cpan -M https://www.cpan.org -T Test::CPAN::Changes
cpanm --notest Test::CPAN::Changes
prove -r -b xt
# Running tests in parallel should be faster, but it's also more
# tricky in cases where different tests share a feature, such as a
Expand All @@ -105,13 +104,14 @@ jobs:
perl Makefile.PL
make disttest
make clean
# And, coverage reports, but only under 5.10 and later since modern
# Devel::Cover instances don't work with 5.8
# And, coverage reports, but only under 5.12 and later since modern
# Devel::Cover instances don't work with earlier versions as of
# Devel::Cover 1.39
- name: Run coverage tests
if: env.PERL_VERSION != 'v5.8'
if: env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
perl Makefile.PL
cover -test -report coveralls
31 changes: 19 additions & 12 deletions .github/workflows/release.yml
@@ -1,10 +1,17 @@
# brian's standard GitHub Actions release config for Perl 5 modules
# version 20220827.002
# version 20230528.001
# https://github.com/briandfoy/github_workflows
# https://github.com/features/actions
# This file is licensed under the Artistic License 2.0
#
# This requires that you configure a repository secret named
# RELEASE_ACTION_TOKEN with a GitHub Personal Access Token
# that has "read and write" permissions on Repository/Contents
name: release

permissions:
contents: write

on:
push:
tags:
Expand All @@ -13,6 +20,7 @@ on:

jobs:
perl:
environment: release
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -53,19 +61,18 @@ jobs:
- name: version
run: echo "::set-output name=version::$(perl -le 'print $ARGV[0] =~ m/(.*?).tar.gz/' *.tar.gz)"
id: version
- name: release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.LOCAL_GITHUB_TOKEN }}
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: Changes
- name: Changes extract
run: |
perl -00 -lne 'next unless /\A\d+\.\d+(_\d+)?/; print; last' Changes > Changes-latest
cat Changes-latest
id: extract
- name: upload
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: Changes-latest
draft: false
prerelease: false
name: ${{ steps.version.outputs.version }}
files: "*.tar.gz"
token: ${{ secrets.RELEASE_ACTION_TOKEN }}

0 comments on commit 7e270cb

Please sign in to comment.