From 964c0c8ae357e2ca913e55ed641d2504bb9e3243 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 11:45:02 +0200 Subject: [PATCH 01/27] GH Action: Fix bug in testing latest perl version --- .github/workflows/linux.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9597177..531474f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -67,12 +67,14 @@ jobs: - id: list-deps-with-verbosity name: List Dependencies With Verbosity run: | - dzil --verbose listdeps --requires --develop recommends --suggests --cpanm-version --omit-core ${{ matrix.perl-version }} + dzil --verbose listdeps --requires --develop recommends --suggests --cpanm-version --omit-core "$(perl -E 'say $];')" + shell: bash - id: install-dzil-deps name: Install Dependencies run: | - dzil listdeps --requires --develop recommends --suggests --cpanm-version --omit-core ${{ matrix.perl-version }} \ + dzil listdeps --requires --develop recommends --suggests --cpanm-version --omit-core "$(perl -E 'say $];')" \ | cpanm --verbose --force --notest || true + shell: bash # - id: build-project-and-explore # name: Build Project And Explore # run: | From 4c36e5a1a1a9e89144d3bbea62f2c19980322306 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 11:52:47 +0200 Subject: [PATCH 02/27] GH Action: Add EXTENDED_TESTING var to linux workflow --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 531474f..0820db6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -16,6 +16,7 @@ jobs: PERL_USE_UNSAFE_INC: 0 AUTHOR_TESTING: 1 AUTOMATED_TESTING: 1 + EXTENDED_TESTING: 1 RELEASE_TESTING: 1 runs-on: ubuntu-latest From 49045a0861c09290dae317c0815ba2f5b64aa809 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 11:53:10 +0200 Subject: [PATCH 03/27] GH Action: Remove Perl 5.30 from linux workflow, no dzil --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0820db6..d9b1f97 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -29,7 +29,7 @@ jobs: - '5.40' - '5.34' - '5.28' - - '5.20' + # - '5.20' No dzil # - '5.18' No dzil # - '5.16' No dzil # - '5.14' No dzil From e25a2b93be290a11853bee531407e55a2b097285 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 11:53:30 +0200 Subject: [PATCH 04/27] GH Action: Update actions/checkout to v6 in linux workflow --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d9b1f97..3f3666d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -43,7 +43,7 @@ jobs: steps: - id: checkout name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - id: explore-tools-perl name: perl -V run: perl -V From 55cb6ad7251c8bc0df058e15a9c57c0696f01495 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 11:54:00 +0200 Subject: [PATCH 05/27] GH Action: Correct typo in linux workflow --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3f3666d..1c32f12 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -12,7 +12,7 @@ on: jobs: perl: env: - # some plugins still needs this to run their tests... + # some plugins still need this to run their tests... PERL_USE_UNSAFE_INC: 0 AUTHOR_TESTING: 1 AUTOMATED_TESTING: 1 From e985d10d780ccf95e1fd33e4c2c9ad43407b8f53 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:00:10 +0200 Subject: [PATCH 06/27] GH Action: Add on->pull_request to linux workflow --- .github/workflows/linux.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1c32f12..f62a3d6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,13 +1,11 @@ name: linux on: + pull_request: push: branches: - '*' - # tags-ignore: - # - '*' workflow_dispatch: -# pull_request: jobs: perl: From 239997cd6749fb606946d69bb1f70f3628781f52 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:01:22 +0200 Subject: [PATCH 07/27] GH Action: Copy changes from env-dot to windows workflow --- .github/workflows/windows.yml | 164 +++++++++++++++++----------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bad8d9c..d687a05 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,71 +1,42 @@ name: windows on: + pull_request: push: branches: - '*' - tags-ignore: - - '*' workflow_dispatch: -# pull_request: jobs: - perl: - # name: Perl Perl ${{ matrix.perl }} on ${{ matrix.os }} - # https://justatheory.com/2021/11/cache-perl-github-workflows/ - env: - # some plugins still needs this to run their tests... - PERL_USE_UNSAFE_INC: 0 - AUTHOR_TESTING: 1 - AUTOMATED_TESTING: 1 - RELEASE_TESTING: 1 - - # strategy: - # matrix: - # os: [ windows ] - # perl: [ 'latest' ] + test: runs-on: windows-latest - # runs-on: ${{ matrix.os }}-latest - steps: - id: checkout name: Checkout - uses: actions/checkout@v4 - - # There is no strategy/matrix because Windows container has its own - # Strawberry Perl and we go with whatever version it is. - - # - id: cache-cpan - # name: Cache CPAN modules - # uses: actions/cache@v4 - # # env: - # # cache-name: cache-cpan-modules - # with: - # # npm cache files are stored in `~/.npm` on Linux/macOS - # # path: ~/.cpan - # # path: local - # path: C:/Strawberry/perl/site/lib - # # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # # key: perl-${{ steps.perl.outputs.perl-hash }} - # key: static - # # restore-keys: | - # # ${{ runner.os }}-build-${{ env.cache-name }}- - # # ${{ runner.os }}-build- - # # ${{ runner.os }}- + uses: actions/checkout@v6 + + - id: setup-strawberry-perl + name: Setup Strawberry Perl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: '5.42' + distribution: strawberry # Critical for Windows compatibility + - id: explore-tools-perl name: Explore Tools Perl + shell: pwsh run: | perl -V + - id: explore-tools-cpan name: Explore Tools Cpan + shell: pwsh run: | cpan -V - - id: explore-tools-cpanm - name: Explore Tools Cpanm - run: | - cpanm -V + - id: explore-filesystem name: Explore Filesystem + shell: pwsh run: | dir dir C:\ @@ -76,57 +47,88 @@ jobs: dir D:\ # dir .cpan # dir .cpan\build + - id: explore-whoami name: Explore Who Am I + shell: pwsh run: | whoami + - id: explore-environment name: Explore Environment shell: pwsh run: | Get-ChildItem env: | Format-Table -Wrap - - id: install-dzil + + - id: install-test2 + name: Install Test2 + shell: pwsh + run: | + cpanm --notest --force Test2::Suite + + - id: install-dist-zilla name: Install Dist::Zilla + shell: pwsh run: | - cpanm --verbose --force --notest Dist::Zilla - # - id: install-extra - # name: Install Extra Dependencies Which Are Somehow Missing - # env: - # PUREPERL_ONLY: 1 - # run: | - # cpanm --verbose --force --notest Test::Perl::Critic - # # - id: - # name: Install Dependencies - # # #run: cpm install -g --no-test --show-build-log-on-failure --cpanfile cpanfile - # # run: cpm install -g --no-test --show-build-log-on-failure --cpanfile cpanfile - # # - id: - # name: Makefile.PL - # # run: perl Makefile.PL - - id: list-dzil-authordeps-with-verbosity - name: List Dist::Zilla Author Dependencies With Verbosity + cpanm --notest --force Dist::Zilla + + - id: explore-missing-dzil-authordeps + name: Explore Missing Dist::Zilla Author Dependencies + shell: pwsh run: | - dzil --verbose authordeps --cpanm-versions - - id: install-dzil-authordeps - name: Install Dist::Zilla Author Dependencies + dzil authordeps --missing --cpanm-versions + + - id: install-missing-dzil-authordeps + name: Install Missing Dist::Zilla Author Dependencies + shell: pwsh run: | - dzil authordeps --cpanm-versions \ - | cpanm --verbose --force --notest || true - - id: list-deps-with-verbosity - name: List Dependencies With Verbosity + $authDeps = dzil authordeps --missing --cpanm-versions + if ($authDeps) { + Write-Host "Installing missing author dependencies: $authDeps" + $authDeps | cpanm --verbose --force --notest + if ($LASTEXITCODE -eq 1) { + Write-Host "cpanm returned 1, but checking if work got done..." + $authDepsCheck = dzil authordeps --missing + # if ($authDepsCheck | ) { + # Write-Host "Work got done successfully despite exit code 1." + # $global:LASTEXITCODE = 0 + # } + } + $global:LASTEXITCODE = 0 + + } else { + Write-Host "No missing author dependencies found." + } + + - id: explore-missing-deps + name: Explore Missing Dependencies + shell: pwsh run: | - dzil --verbose listdeps --develop --requires --recommends --suggests --cpanm-version - - id: install-dzil-deps - name: Install Dependencies - # dzil listdeps --requires --develop recommends --suggests --cpanm-version --omit-core ${{ matrix.perl-version }} \ + dzil listdeps --missing --develop --requires --no-recommends --no-suggests --cpanm-version + + - id: install-missing-deps + name: Install Missing Dependencies + shell: pwsh run: | - dzil listdeps --requires --develop recommends --suggests --cpanm-version \ - | cpanm --verbose --force --notest || true - # - id: build-project-and-explore - # name: Build Project And Explore - # run: | - # dzil --verbose build \ - # && Get-ChildItem -Path -Recurse -Force -Exclude .git + $listDeps = dzil listdeps --missing --develop --requires --no-recommends --no-suggests --cpanm-version + if ($listDeps) { + Write-Host "Installing missing dependencies: $listDeps" + $listDeps | cpanm --verbose --force --notest + if ($LASTEXITCODE -eq 1) { + Write-Host "cpanm returned 1, but checking if work got done..." + dzil listdeps --missing --develop --requires --no-recommends --no-suggests + # if ($?) { + # Write-Host "Work got done successfully despite exit code 1." + # $global:LASTEXITCODE = 0 + # } + } + $global:LASTEXITCODE = 0 + } else { + Write-Host "No missing dependencies found." + } + - id: run-tests name: Run Tests + shell: pwsh run: | - dzil --verbose test --all --test-verbose + dzil test --no-author From d3e056c77118be974580a3ad2260f39bb2388c1e Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:23:51 +0200 Subject: [PATCH 08/27] Add build badges to README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 559ad91..0dfc9a3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![CPAN Version](https://img.shields.io/cpan/v/Env-Assert)](https://metacpan.org/dist/Env-Assert) [![kwalitee](https://cpants.cpanauthors.org/dist/Env-Assert.svg)](https://cpants.cpanauthors.org/dist/Env-Assert) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) +[![Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) +[![Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) # envassert From 1c82c6f1751cda3cb324b349e76442bdc3cea61c Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:31:04 +0200 Subject: [PATCH 09/27] GH Action: Add ci workflow --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ace23b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: CI +on: + pull_request: + push: + branches: + - 'main' + branches: + - '*' + workflow_dispatch: + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + container: + image: perldocker/perl-tester:5.42 + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v6 + - id: run-tests + name: Run Tests + env: + PERL_USE_UNSAFE_INC: 0 + AUTHOR_TESTING: 1 + AUTOMATED_TESTING: 1 + EXTENDED_TESTING: 1 + RELEASE_TESTING: 1 + run: auto-build-and-test-dist + - id: upload-artifact + # Upload artifact to a GitHub Actions "storage". + name: Upload Build + uses: actions/upload-artifact@v7.0.1 + with: + name: build_dir + path: build_dir + coverage: + needs: build + runs-on: ubuntu-latest + container: + image: perldocker/perl-tester:5.42 + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v6 + - id: download-artifact + # Download the artifact that was uploaded in earlier step. + name: Download Build + uses: actions/download-artifact@v8.0.1 + with: + name: build_dir + path: . + - id: install-deps + name: Install deps + run: cpan-install-dist-deps + - id: test + name: Test + run: test-dist + env: + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}} From 60740f7abf750e452ee9e3012671dde6f5a1fd7f Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:32:24 +0200 Subject: [PATCH 10/27] GH Action: Add ci workflow, fix #1 --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ace23b1..3fba57c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,6 @@ name: CI on: pull_request: push: - branches: - - 'main' branches: - '*' workflow_dispatch: From c5200877517d4a185a2c8cf27ef878f62fb0b669 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:39:25 +0200 Subject: [PATCH 11/27] Add Codecov badge to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0dfc9a3..0a79fa3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![License: Artistic-2.0](https://img.shields.io/badge/License-Perl-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0) [![CPAN Version](https://img.shields.io/cpan/v/Env-Assert)](https://metacpan.org/dist/Env-Assert) [![kwalitee](https://cpants.cpanauthors.org/dist/Env-Assert.svg)](https://cpants.cpanauthors.org/dist/Env-Assert) +[![codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) [![Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) [![Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) From ae63081d7885b03d427c0b478d4226f58dfeb26c Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 12:56:16 +0200 Subject: [PATCH 12/27] Build: do not generate README, we include weaved README.md now --- dist.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dist.ini b/dist.ini index 60736a6..82d2ff3 100644 --- a/dist.ini +++ b/dist.ini @@ -31,9 +31,7 @@ include_dotfiles = 1 -version = 0.003 -remove = GatherDir -remove = Test::Perl::Critic - -[Software::Policies / License] -policy_attribute = perl_5_double_license = true +-remove = Readme ; No need to include README file because we include the weaved README.md [Software::Policies / AIDisclosure] policy_attribute = ai_tools = Claude AI, Copilot and Gemini From 1e556fb2de0052c7cca2ddee18ae917427a8cc58 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:17:19 +0200 Subject: [PATCH 13/27] Remove tabs --- t/lib/Test2/Require/Platform/OS/Unix.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/lib/Test2/Require/Platform/OS/Unix.pm b/t/lib/Test2/Require/Platform/OS/Unix.pm index f763e73..20e394f 100644 --- a/t/lib/Test2/Require/Platform/OS/Unix.pm +++ b/t/lib/Test2/Require/Platform/OS/Unix.pm @@ -10,24 +10,24 @@ use English qw( -no_match_vars ) ; # Avoids regex performance my %PLATFORMS = ( 'aix' => 1, - 'bsdos' => 1, + 'bsdos' => 1, 'darwin' => 1, 'dynixptx' => 1, - 'freebsd' => 1, + 'freebsd' => 1, 'haiku' => 1, 'linux' => 1, 'hpux ' => 1, 'irix ' => 1, 'darwin' => 1, 'next' => 1, - 'openbsd' => 1, - 'dec_osf' => 1, - 'svr4' => 1, - 'sco_sv' => 1, - 'unicos' => 1, - 'unicosmk' => 1, - 'solaris' => 1, - 'sunos' => 1, + 'openbsd' => 1, + 'dec_osf' => 1, + 'svr4' => 1, + 'sco_sv' => 1, + 'unicos' => 1, + 'unicosmk' => 1, + 'solaris' => 1, + 'sunos' => 1, ); sub IS_PLATFORM { From 921d73c5b6eaee00a445ceb97f46c3c30912d6b7 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:35:04 +0200 Subject: [PATCH 14/27] Remove PodWeaver and PerlTidy from dist.ini/@MIKKOI --- dist.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist.ini b/dist.ini index 82d2ff3..b2c5348 100644 --- a/dist.ini +++ b/dist.ini @@ -32,6 +32,8 @@ include_dotfiles = 1 -remove = GatherDir -remove = Test::Perl::Critic -remove = Readme ; No need to include README file because we include the weaved README.md +-remove = PodWeaver +-remove = PerlTidy [Software::Policies / AIDisclosure] policy_attribute = ai_tools = Claude AI, Copilot and Gemini From ba74bd09966359177ecf410aa341cfcdf9163194 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:35:44 +0200 Subject: [PATCH 15/27] Add Prereqs / DevelopSuggests suggests to dist.ini --- dist.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dist.ini b/dist.ini index b2c5348..098a326 100644 --- a/dist.ini +++ b/dist.ini @@ -35,6 +35,13 @@ include_dotfiles = 1 -remove = PodWeaver -remove = PerlTidy +[Prereqs / DevelopSuggests] +Dist::Zilla::App::Command::podpreview = 0.004 +Dist::Zilla::App::Command::cover = 0 +Devel::Cover::Report::Codecov = 0 +Devel::Cover::Report::Coveralls = 0 +App::RewriteVersion = 1.000 + [Software::Policies / AIDisclosure] policy_attribute = ai_tools = Claude AI, Copilot and Gemini From 784c55165ff2bd229e1aa289135dd01da2c8c777 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:36:12 +0200 Subject: [PATCH 16/27] Add AUTHOR AND Legal to all lib/ files --- lib/Env/Assert.pm | 12 +++++++++++- lib/Env/Assert/Functions.pm | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Env/Assert.pm b/lib/Env/Assert.pm index 4622802..5a411b8 100644 --- a/lib/Env/Assert.pm +++ b/lib/Env/Assert.pm @@ -137,8 +137,18 @@ Read environment variables from a F<.env> file directly into you program. There is also script F which can turn F<.env> file's content into environment variables for different shells. +=head1 AUTHOR + +Mikko Koivunalho + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2023 by Mikko Koivunalho. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + =cut 1; - __END__ diff --git a/lib/Env/Assert/Functions.pm b/lib/Env/Assert/Functions.pm index e4af7ee..7cfcfb8 100644 --- a/lib/Env/Assert/Functions.pm +++ b/lib/Env/Assert/Functions.pm @@ -269,6 +269,17 @@ Read environment variables from a F<.env> file directly into you program. There is also script F which can turn F<.env> file's content into environment variables for different shells. +=head1 AUTHOR + +Mikko Koivunalho + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2023 by Mikko Koivunalho. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + =cut 1; From 07167de991b81caf3c7ba6dc9530f4256c51d388 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:41:27 +0200 Subject: [PATCH 17/27] Add Coveralls badge to README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a79fa3..d6124f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ [![License: Artistic-2.0](https://img.shields.io/badge/License-Perl-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0) [![CPAN Version](https://img.shields.io/cpan/v/Env-Assert)](https://metacpan.org/dist/Env-Assert) [![kwalitee](https://cpants.cpanauthors.org/dist/Env-Assert.svg)](https://cpants.cpanauthors.org/dist/Env-Assert) -[![codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) +[![Coverage Status](https://coveralls.io/repos/github/mikkoi/env-assert/badge.svg?branch=add-codecov-report)](https://coveralls.io/github/mikkoi/env-assert?branch=add-codecov-report) +[![Codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) [![Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) [![Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) From 9a7f2742cdd352a10b776bce1373d9521ad20fba Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:42:06 +0200 Subject: [PATCH 18/27] Add Rename GH Action workflows in README.md badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6124f2..131983d 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![Coverage Status](https://coveralls.io/repos/github/mikkoi/env-assert/badge.svg?branch=add-codecov-report)](https://coveralls.io/github/mikkoi/env-assert?branch=add-codecov-report) [![Codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) -[![Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) -[![Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) +[![GH Actions: Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) +[![GH Actions: Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) # envassert From b20572276f44b2516086da8695ff5edd6e28b604 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 15:46:03 +0200 Subject: [PATCH 19/27] GH Actions: Rename secrets.COVERALLS_TOKEN to COVERALLS_REPO_TOKEN --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fba57c..9032734 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,4 +56,4 @@ jobs: run: test-dist env: CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} - COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}} + COVERALLS_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}} From a1b58c8b395e093ddf072e02e19f496a82ca7947 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:14:49 +0200 Subject: [PATCH 20/27] Sort Software::Policies in dist.ini --- dist.ini | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist.ini b/dist.ini index 098a326..6657aa2 100644 --- a/dist.ini +++ b/dist.ini @@ -45,13 +45,16 @@ App::RewriteVersion = 1.000 [Software::Policies / AIDisclosure] policy_attribute = ai_tools = Claude AI, Copilot and Gemini +[Software::Policies / CodeOfConduct] +class = ContributorCovenant +version = 2.1 + [Software::Policies / Contributing] policy_attribute = ai_disclosure = 1 policy_attribute = ai_assisted = 1 -[Software::Policies / CodeOfConduct] -class = ContributorCovenant -version = 2.1 +[Software::Policies / License] +policy_attribute = perl_5_double_license = true [Software::Policies / Security] policy_attribute = url = https://github.com/mikkoi/env-assert/blob/main/SECURITY.md From 5516f0421686253fe0e5f3b0177b95f577bfb62a Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:19:06 +0200 Subject: [PATCH 21/27] Remove README.md from MANIFEST.SKIP, update --- MANIFEST.SKIP | 1 - README.md | 116 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 103 insertions(+), 14 deletions(-) diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index e501de7..f49350e 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -17,5 +17,4 @@ local/ .lvimrc Session.vim dzil-generated-cpanfile -README.md envassert.self-contained diff --git a/README.md b/README.md index 131983d..d9e9c5c 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,40 @@ [![GH Actions: Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) [![GH Actions: Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) -# envassert +# Env-Assert + +Ensure that the environment variables match what is requested, or abort. Module and executable. + + +# VERSION + +0.016 + + +# SYNOPSIS + + use Env::Assert 'assert'; + # or: + use Env::Assert assert => { + envdesc_file => 'another-envdesc', + break_at_first_error => 1, + }; + + # .envdesc file: + # MY_VAR=.+ + + # use any verified environment variable + say $ENV{MY_VAR}; + + # You can inline the envdesc file: + use Env::Assert assert => { + exact => 1, + envdesc => <<'EOF' + NUMERIC_VAR=^[[:digit:]]+$ + TIME_VAR=^\d{2}:\d{2}:\d{2}$ + EOF + }; -Ensure that the environment variables match -what is requested, or abort. # DESCRIPTION @@ -18,24 +48,83 @@ what is requested, or abort. with environment variables, matches with what you want. You can define your required environment in a file. -Default file is **.envdesc** but you can use any file. +Default file is `.envassert` but you can use any file. + It is advantageous to use **envassert** for example when running a container. If you check your environment for missing or wrongly defined environment variables at the beginning of the container run, your container will fail sooner instead of in a later point in execution when the variables are needed. -# SYNOPSIS +## Errors + +There are three kinds of errors: + +- ENV\_ASSERT\_MISSING\_FROM\_ENVIRONMENT + + "Variable <var\_name> is missing from environment" + +- ENV\_ASSERT\_INVALID\_CONTENT\_IN\_VARIABLE + + "Variable <var\_name> has invalid content" + +- ENV\_ASSERT\_MISSING\_FROM\_DEFINITION + + "Variable <var\_name> is missing from description" + + This error will only be reported if you have set + the special option **exact**. See below. + +## Environment Description Language -envassert [options] +Environment is described in file `.envdesc`. +Environment description file is a Unix shell compatible file, +similar to a `.env` file. -Options: +### `.envdesc` Format + +In `.envdesc` file there is only environment variables, comments +or empty rows. +Example: + + # Required env + ## envassert (opts: exact=1) + FILENAME=^[[:word:]]{1,}$ + +Env var name is followed by a regular expression. The regexp is +an extended Perl regular expression without quotation marks. +One env var and its descriptive regexp use one row. + +A comment begins at the beginning of the row and uses the whole row. +It start with '#' character. + +Two comment characters and the word **envassert** at the beginning of the row +mean this is an **envassert** meta command. +You can specify different environment related options with these commands. + +Supported options: + +- exact + + The option _exact_ means that all allowed env variables + are described in this file. Any unknown env var causes an error + when verifying. + +## CLI interface without dependencies + +The `envassert` command is also available +as self contained executable. +You can download it and run it as it is without +additional installation of CPAN packages. +Of course, you still need Perl, but Perl comes with any +normal Linux installation. + +This can be convenient if you want to, for instance, +include `envassert` in a docker container build. + + curl -LSs -o envassert https://raw.githubusercontent.com/mikkoi/env-assert/main/envassert.self-contained + chmod +x ./envassert - --help - --man - --version - --break-at-error - --env-description ## INSTALLATION @@ -58,9 +147,10 @@ include **envassert** in a docker container build. curl -LSs -o envassert https://raw.githubusercontent.com/mikkoi/env-assert/main/envassert.self-contained chmod +x ./envassert + # LICENSE -This software is copyright (c) 2023 by Mikko Koivunalho. +This software is copyright (c) 2026 by Mikko Koivunalho . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. From ce18e747b127ebecfa104946db81576be4c2f6ad Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:19:35 +0200 Subject: [PATCH 22/27] Add .weavefilerc --- .weavefilerc | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .weavefilerc diff --git a/.weavefilerc b/.weavefilerc new file mode 100644 index 0000000..fe4c645 --- /dev/null +++ b/.weavefilerc @@ -0,0 +1,77 @@ +--- +snippets: + license: | + # LICENSE + + This software is copyright (c) 2026 by [% dist.author %]. + + This is free software; you can redistribute it and/or modify it under + the same terms as the Perl 5 programming language system itself. + + Terms of the Perl programming language system itself: + + a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or + b) the "Artistic License" + + The complete licenses are in the files LICENSE-Artistic-2.0 and LICENSE-GPL-3 + within this repository. If these files are missing, they can be downloaded + from the following urls: + + * https://www.gnu.org/licenses/ + * https://www.perlfoundation.org/artistic-license-20.html + badges: | + [![License: Artistic-2.0](https://img.shields.io/badge/License-Perl-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0) + [![CPAN Version](https://img.shields.io/cpan/v/Env-Assert)](https://metacpan.org/dist/Env-Assert) + [![kwalitee](https://cpants.cpanauthors.org/dist/Env-Assert.svg)](https://cpants.cpanauthors.org/dist/Env-Assert) + [![codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) + [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) + [![Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) + [![Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) + packaging_badge: | + ### Packaging + + [![Packaging status](https://repology.org/badge/vertical-allrepos/env-assert.svg)](https://repology.org/project/env-assert/versions) +files: + "README.md": | + [% snippets.badges -%] + + # [% dist.name %] + + [% dist.abstract -%] + + [% pod("Env::Assert", "VERSION") %] + + # VERSION + + [% dist.version %] + + + [% pod("Env::Assert", "SYNOPSIS") %] + + + [% pod("bin/envassert", "DESCRIPTION") %] + + + ## INSTALLATION + + [% snippets.packaging_badge -%] + + ### CLI interface without dependencies + + The **envassert** command is also available + as self contained executable. + You can download it and run it as it is without + additional installation of CPAN packages. + Of course, you still need Perl, but Perl comes with any + normal Linux installation. + + This can be convenient if you want to, for instance, + include **envassert** in a docker container build. + + curl -LSs -o envassert https://raw.githubusercontent.com/mikkoi/env-assert/main/envassert.self-contained + chmod +x ./envassert + + + [% snippets.license %] From 894f4213dfdca99cdbe36f84e312a5c1f9ff073f Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:20:09 +0200 Subject: [PATCH 23/27] Update bundle @MIKKOI to version 0.005 --- dist.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist.ini b/dist.ini index 6657aa2..7247ffe 100644 --- a/dist.ini +++ b/dist.ini @@ -28,7 +28,7 @@ include_dotfiles = 1 [@Filter] -bundle = @MIKKOI --version = 0.003 +-version = 0.005 -remove = GatherDir -remove = Test::Perl::Critic -remove = Readme ; No need to include README file because we include the weaved README.md From adc01e82884f8778abeb76aa2efc834a38283b36 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:20:26 +0200 Subject: [PATCH 24/27] Add WeaveFile to dist.ini --- dist.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist.ini b/dist.ini index 7247ffe..b698f89 100644 --- a/dist.ini +++ b/dist.ini @@ -61,6 +61,10 @@ policy_attribute = url = https://github.com/mikkoi/env-assert/blob/main/SECURITY policy_attribute = timeframe = 14 days policy_attribute = perl_support_years = 10 +[WeaveFile / README.md] + +[Test::WeaveFile] + ; After release, always update the self-contained executables to GitHub. ; Use the one that was released. It now contains the current version number. [Run::AfterRelease] From 03b7981e4620cfe000bf9a910a6ec6ef77aadec5 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:25:37 +0200 Subject: [PATCH 25/27] Update .weavefile --- .weavefilerc | 5 +++-- README.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.weavefilerc b/.weavefilerc index fe4c645..b96c997 100644 --- a/.weavefilerc +++ b/.weavefilerc @@ -26,9 +26,10 @@ snippets: [![CPAN Version](https://img.shields.io/cpan/v/Env-Assert)](https://metacpan.org/dist/Env-Assert) [![kwalitee](https://cpants.cpanauthors.org/dist/Env-Assert.svg)](https://cpants.cpanauthors.org/dist/Env-Assert) [![codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) + [![Coverage Status](https://coveralls.io/repos/github/mikkoi/env-assert/badge.svg?branch=add-codecov-report)](https://coveralls.io/github/mikkoi/env-assert?branch=add-codecov-report) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) - [![Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) - [![Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) + [![GH Actions: Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) + [![GH Actions: Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) packaging_badge: | ### Packaging diff --git a/README.md b/README.md index d9e9c5c..672c699 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ [![License: Artistic-2.0](https://img.shields.io/badge/License-Perl-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0) [![CPAN Version](https://img.shields.io/cpan/v/Env-Assert)](https://metacpan.org/dist/Env-Assert) [![kwalitee](https://cpants.cpanauthors.org/dist/Env-Assert.svg)](https://cpants.cpanauthors.org/dist/Env-Assert) +[![codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) [![Coverage Status](https://coveralls.io/repos/github/mikkoi/env-assert/badge.svg?branch=add-codecov-report)](https://coveralls.io/github/mikkoi/env-assert?branch=add-codecov-report) -[![Codecov](https://codecov.io/gh/mikkoi/env-assert/graph/badge.svg?token=WSOLKXXEVK)](https://codecov.io/gh/mikkoi/env-assert) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikkoi/env-assert) [![GH Actions: Linux Build](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/linux.yml) [![GH Actions: Windows Build](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml/badge.svg?event=push&branch=main)](https://github.com/mikkoi/env-assert/actions/workflows/windows.yml) From 9ad1a82a042dfaaa34be8deab595f70258560384 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:34:04 +0200 Subject: [PATCH 26/27] Update lib files --- lib/Env/Assert.pm | 8 ++++++++ lib/Env/Assert/Functions.pm | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/Env/Assert.pm b/lib/Env/Assert.pm index 5a411b8..eeb36c6 100644 --- a/lib/Env/Assert.pm +++ b/lib/Env/Assert.pm @@ -45,6 +45,14 @@ use constant { =for :stopwords env filepath filepaths +=head1 NAME + +Env::Assert - Ensure that the environment variables match what you need, or abort + +=head1 VERSION + +version 0.016 + =head1 SYNOPSIS =for test_synopsis BEGIN { die 'SKIP: no .envdesc file here' } diff --git a/lib/Env/Assert/Functions.pm b/lib/Env/Assert/Functions.pm index 7cfcfb8..22c285f 100644 --- a/lib/Env/Assert/Functions.pm +++ b/lib/Env/Assert/Functions.pm @@ -61,11 +61,13 @@ use constant { INDENT => q{ }, }; -=head1 STATUS +=head1 NAME -Package Env::Assert is currently being developed so changes in the API are possible, -though not likely. +Env::Assert::Functions - The functionality of Env::Assert and bin/envassert. + +=head1 VERSION +version 0.016 =head1 SYNOPSIS @@ -86,6 +88,10 @@ though not likely. print report_errors( $r->{'errors'} ); } +=head1 STATUS + +Package Env::Assert is currently being developed so changes in the API are possible, +though not likely. =head1 NOTES From 6c1f1bba2b87a9153cb4f8d385dce217aa6ef8d1 Mon Sep 17 00:00:00 2001 From: Mikko Koivunalho Date: Sun, 17 May 2026 17:39:27 +0200 Subject: [PATCH 27/27] Update README --- .weavefilerc | 7 ++----- README.md | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.weavefilerc b/.weavefilerc index b96c997..6b9f400 100644 --- a/.weavefilerc +++ b/.weavefilerc @@ -40,13 +40,10 @@ files: # [% dist.name %] - [% dist.abstract -%] + [% dist.abstract %] - [% pod("Env::Assert", "VERSION") %] - - # VERSION - [% dist.version %] + [% pod("Env::Assert", "VERSION") %] [% pod("Env::Assert", "SYNOPSIS") %] diff --git a/README.md b/README.md index 672c699..a0e5043 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Ensure that the environment variables match what is requested, or abort. Module # VERSION -0.016 +version 0.016 # SYNOPSIS