-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Workflows to Github Action (#15)
* Updated Actions workflow with build and release jobs * removed circleCI config * Added concurrency setting to build_workflow * switched actions to use commit hash * Updated indentation
- Loading branch information
1 parent
943d2bb
commit cf050a5
Showing
2 changed files
with
95 additions
and
108 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --no-test -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 -n --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 --no-test -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 -n --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 release |