Skip to content

Commit

Permalink
Migrate to Github Actions (#18)
Browse files Browse the repository at this point in the history
* Updated workflow with test and release jobs

* removed circleCI config

* Added concurrency setting to build_workflow

* updated actions to use commit hash

* Updated intendation
  • Loading branch information
nihal-deriv committed Jan 15, 2024
1 parent d520b3d commit d150450
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 108 deletions.
94 changes: 0 additions & 94 deletions .circleci/config.yml

This file was deleted.

109 changes: 95 additions & 14 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,99 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€
on: [push]
name: Build workflow
run-name: Build workflow
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Explore-GitHub-Actions:
test:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}
strategy:
matrix:
perl-version:
- '5.24'
- '5.26'
- '5.28'
- '5.30'
- '5.32'
- '5.34'
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4
-
name: Install Dzil
run: cpm install -g --no-test Dist::Zilla Dist::Zilla::App::Command::cover ExtUtils::MakeMaker
-
name: Install dzil author dependencies
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
cpm install -g \
-w 2 \
--mirror=http://cpan.cpantesters.org/ $(dzil authordeps --missing)
-
name: Install dist deps
run: |
# see https://github.com/team-at-cpan/Dist-Zilla-Plugin-PodInherit/issues/1 to check why we not use
# dzil listdeps --missing directly here
cpanm --installdeps .
dzil listdeps --author --missing --cpanm-versions | xargs cpanm -n
-
name: Run Tests
run: dzil smoke --release --author && dzil cover -test -report coveralls && dzil xtest
release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
container:
image: perldocker/perl-tester:5.34
env:
PAUSE_USER: ${{ secrets.PAUSE_USER }}
PAUSE_PASSWORD: ${{ secrets.PAUSE_PASSWORD }}
needs: test
steps:
-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4
-
name: Install Dzil
run: cpm install -g --no-test Dist::Zilla Dist::Zilla::App::Command::cover ExtUtils::MakeMaker
-
name: Install dzil author dependencies
run: |
cpm install -g \
-w 2 \
--mirror=http://cpan.cpantesters.org/ $(dzil authordeps --missing)
-
name: Install dist deps
run: |
# see https://github.com/team-at-cpan/Dist-Zilla-Plugin-PodInherit/issues/1 to check why we not use
# dzil listdeps --missing directly here
cpanm --installdeps .
dzil listdeps --author --missing --cpanm-versions | xargs cpanm -n
-
name: setup PAUSE account
run: echo -e "user $PAUSE_USER\npassword $PAUSE_PASSWORD\n" >> ~/.pause
-
name: setup git
run: |
git config --global user.email "github-actions@binary.com"
git config --global user.name "github-actions"
# set remote github because dzil will push to github
# https://metacpan.org/release/DERIV/Dist-Zilla-PluginBundle-Author-DERIV-0.003/source/lib/Dist/Zilla/PluginBundle/Author/DERIV.pm#L122
git remote add github $(git remote get-url origin)
-
name: Release to PAUSE
run: |
if grep -Pzq '\{\{\$NEXT\}\}\n\s*\n' Changes
then
echo "No changes, no need release"
exit 0
fi
# use git push to test permission
git push github master
echo "y\n" | DZIL_CONFIRMRELEASE_DEFAULT=y dzil

0 comments on commit d150450

Please sign in to comment.