Skip to content

Add local-lib for easy caching #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c3b4108
Performing change perl-actions/install-with-cpanm#24 by @quarckster
JJ Apr 2, 2024
18edfa7
Upgrading to stave off perl-actions/install-with-cpanm#23 and follow …
JJ Apr 2, 2024
ac9adbb
Changing URLs
JJ Apr 2, 2024
1dff759
:recycle: perl-actions/install-with-cpanm#22 perl-actions/install-wit…
JJ Apr 2, 2024
1eccbda
:coffin:
JJ Apr 2, 2024
08bc2bc
:coffin:
JJ Apr 2, 2024
aaf68bd
:recycle:
JJ Apr 2, 2024
d49e030
Setting up perl-actions/install-with-cpanm#2
JJ Apr 2, 2024
d79a802
Implementing env var perl-actions/install-with-cpanm#2
JJ Apr 2, 2024
437b2bd
perl-actions/install-with-cpanm#2 testing
JJ Apr 2, 2024
296823e
:recycle:
JJ Apr 2, 2024
c3171b5
Working well, but let's see the variables
JJ Apr 2, 2024
9214a71
:construction:
JJ Apr 2, 2024
c29825e
Local lib needs false sudo
JJ Apr 2, 2024
ac776c7
Let's see what it's doing...
JJ Apr 2, 2024
febadd0
:recycle: closes #1
JJ Apr 2, 2024
f49f664
:recycle:
JJ Apr 2, 2024
1a0576d
Adding linting. Quality is important
JJ Apr 2, 2024
26a9752
:rotating_light:
JJ Apr 2, 2024
472f93d
:memo:
JJ Apr 3, 2024
f7892da
Badge up
JJ Apr 3, 2024
2b4d668
Change name and branding
JJ Apr 3, 2024
15e5f2a
:crossed_swords: and fixed :bug:
JJ Apr 5, 2024
9625fae
I guess that does not apply
JJ Apr 5, 2024
baad5a1
Refers to original
JJ Apr 5, 2024
4ab6f5a
:bug:
JJ Apr 5, 2024
8a59e1d
:recycle:
JJ Apr 5, 2024
333b49b
No more JJs
JJ Apr 5, 2024
78bdd7f
:memo:
JJ Apr 5, 2024
8843940
Fixed eslint error
JJ Apr 6, 2024
b170e5e
Change to equivalent input variable
JJ Apr 6, 2024
503c434
:coffin:
JJ Apr 6, 2024
3c29273
Rewrite config with new version
JJ Apr 6, 2024
d5dad82
Solving the config issue
JJ Apr 6, 2024
79b0eb1
I mean, really
JJ Apr 6, 2024
d1fc610
:recycle: and use CommonJS config
JJ Apr 6, 2024
66823f5
:memo: no more tabs
JJ Apr 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: check
name: Check workflow

on: [push]
on: [push, pull_request]

jobs:
cpanm:
Expand Down Expand Up @@ -158,3 +157,20 @@ jobs:
# checking that both modules are installed
- run: perl -Mabbreviation -e1
- run: perl -MACH -e1

## ------------------------------------------------
## test with local-lib
## ------------------------------------------------
local_lib:
runs-on: ubuntu-latest
name: 'local-lib'

steps:
- uses: actions/checkout@v4
- name: 'install-with-cpanm'
uses: ./
with:
install: 'Simple::Accessor'
local-lib: '~/perl5'
sudo: false
args: '-v'
23 changes: 23 additions & 0 deletions .github/workflows/lint-javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint javascript
on:
push:
paths:
- '*.js'
- '.github/workflows/lint-javascript.yml'
- 'eslint.config.js'
- 'package*'
pull_request:
paths:
- '*.js'
- '.github/workflows/lint-javascript.yml'
- 'eslint.config.js'
- 'package*'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Lint javascript
run: npm run lint
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Actions Status](https://github.com/perl-actions/install-with-cpanm/workflows/check/badge.svg)](https://github.com/perl-actions/install-with-cpanm/actions)
[![Actions Status](https://github.com/perl-actions/install-with-cpanm/workflows/check/badge.svg)](https://github.com/perl-actions/install-with-cpanm/actions) [![Lint javascript](https://github.com/perl-actions/install-with-cpanm/actions/workflows/lint-javascript.yml/badge.svg)](https://github.com/perl-actions/install-with-cpanm/actions/workflows/lint-javascript.yml)

# install-with-cpanm

Expand All @@ -8,7 +8,7 @@ This action installs 'cpanminus' then use it if needed to install some Perl Modu

```yaml
- name: install cpanm and multiple modules
uses: perl-actions/install-with-cpanm@stable
uses: perl-actions/install-with-cpanm@v1
with:
install: |
Simple::Accessor
Expand All @@ -22,6 +22,8 @@ This action installs 'cpanminus' then use it if needed to install some Perl Modu
# path: "$Config{installsitescript}/cpanm"
# which perl binary to use
# perl: 'perl'
# Use a local library
# local-lib: ~/perl5
```

## Using install-with-cpanm in a GitHub workflow
Expand Down Expand Up @@ -53,7 +55,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpanm
uses: perl-actions/install-with-cpanm@stable
uses: perl-actions/install-with-cpanm@v1
with:
cpanfile: "cpanfile"
sudo: false
Expand Down Expand Up @@ -113,6 +115,11 @@ By setting PATH correctly you probably do not need to use it.
Where to install `cpanm`. Default value is `$Config{installsitescript}/cpanm`.
You can use any `$Config` variable in your string.

### `local-lib`

Local (user space) library where `cpanm` will install the distributions. Use
this for caching, for instance.

## Outputs

none
Expand Down Expand Up @@ -199,3 +206,38 @@ windows:
- run: perl -Mabbreviation -e1
- run: perl -MACH -e1
```

### Using install-with-cpanm for installation in local library

```yaml
local_lib:
runs-on: ubuntu-latest
name: 'local-lib'

steps:
- uses: actions/checkout@v4
- name: 'install-with-cpanm'
uses: ./
with:
install: 'Simple::Accessor'
local-lib: '~/perl5'
sudo: false
verbose: true
```


## License
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this license for clarity, since I was forking. You might want either to delete it, or to expand collaborator names from nicks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed we might prefer a more generic Perl'ish license

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you will need to change the short license name in package.json, assuming that artistic-2.0 is compatible with it. I guess ISC (the one here, which I just transcribed, keeping it in package.json) is the license in the boilerplate originally used, but it's pretty permissive, so I guess it's not a problem to change it. IIRC, the artistic will need to add a LICENSE file too here.


Copyright (c) 2022-2024, Atoomic, Olaf Alders, haarg, Brian C. Arnold, mohawk2

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "install with cpanm"
name: "install with cpanm action"
description: "install Perl Modules with App::cpanminus"
branding:
icon: "arrow-right"
icon: "arrow-down"
color: "blue"

inputs:
Expand Down Expand Up @@ -42,6 +42,10 @@ inputs:
required: false
default: "$Config{installsitescript}/cpanm"

local-lib:
description: "Path where to install modules"
required: false

runs:
using: "node20"
main: "dist/index.js"
Loading