Skip to content

Commit

Permalink
Robustify GitHub CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
trwyant committed Feb 1, 2024
1 parent 023b040 commit e9f45ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ jobs:
run: |
perl -v
- name: Customize environment
- name: Install support modules
continue-on-error: true
run: |
cpanm -v
cpanm File::HomeDir Getopt::Long version
- name: Customize environment
run: |
perl .github/workflows/environment.PL
- name: Display local envoronment variables
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/environment.PL
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use 5.006002;
use strict;
use warnings;

use File::HomeDir;
use Getopt::Long;
use version;

Expand Down Expand Up @@ -45,8 +44,21 @@ sub compute_environment {
dos => 1,
}->{$^O} || '';
my $is_unix = $is_windows ? '' : 1;
my $my_home;
{
local $@ = undef;
eval {
require File::HomeDir;
$my_home = File::HomeDir->my_home();
print "Home from File::HomeDir\n";
1;
} or do {
$my_home = $ENV{HOME};
print "Home from \$HOME\n";
};
}
my %env = (
MY_HOME => File::HomeDir->my_home(),
MY_HOME => $my_home,
MY_IS_GITHUB_ACTION => 1,
MY_IS_UNIX => $is_unix,
MY_IS_WINDOWS => $is_windows,
Expand Down

0 comments on commit e9f45ff

Please sign in to comment.