Skip to content

Commit

Permalink
Merge pull request #9 from tbrowder/new-ver
Browse files Browse the repository at this point in the history
New version ready for release
  • Loading branch information
tbrowder authored Oct 23, 2023
2 parents fc79a98 + 6d5fff8 commit cf06858
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 9 deletions.
6 changes: 5 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Revision history for Mi6-Helper

{{$NEXT}}
- Corrected handling of .github/workflow files by
copying them to the resources directory so they
are accessible to the %?RESOURCES hash.
- Eliminate the .github/workflows/test.yml file.

0.10.1 2023-10-03T13:28:59-05:00
- Correct Steve's handle:
- Correct Steve's handle
- Clearer code using 'cmd' from module'Pro::Easier' instead of 'raku's 'run'
(thanks, @sdondley!)

Expand Down
3 changes: 3 additions & 0 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"Mi6::Helper": "lib/Mi6/Helper.rakumod"
},
"resources": [
"linux.yml",
"macos.yml",
"windows.yml"
],
"source-url": "https://github.com/tbrowder/Mi6-Helper.git",
"tags": [
Expand Down
28 changes: 20 additions & 8 deletions lib/Mi6/Helper.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ sub get-hidden-name(:$module-name) is export {
sub mi6-helper-old(:$parent-dir!, :$module-name!, :$provides, :$debug) is export {
}

sub get-file-content($fnam --> Str) is export {
#$?DISTRIBUTION.content("resources/$fnam").open.slurp;
%?RESOURCES{$fnam}.slurp;
}

sub mi6-helper-new(:$parent-dir!, :$module-name!, :$provides, :$debug) is export {

# test module is "Foo::Bar"
Expand Down Expand Up @@ -150,20 +155,27 @@ sub mi6-helper-new(:$parent-dir!, :$module-name!, :$provides, :$debug) is export
$fh.close;

# use the Mi6-Helper/.github/workflows/*.yml files as I've updated them
# but they will be in DISTRIBUTION.contents
# note the file handles are CLOSED!!
my $Lstr = $?DISTRIBUTION.content(".github/workflows/linux.yml").open.slurp;
my $Mstr = $?DISTRIBUTION.content(".github/workflows/macos.yml").open.slurp;
my $Wstr = $?DISTRIBUTION.content(".github/workflows/windows.yml").open.slurp;

my $Lfil = "$modpdir/.github/workflows/linux.yml";
my $Mfil = "$modpdir/.github/workflows/macos.yml";
my $Wfil = "$modpdir/.github/workflows/windows.yml";
my $Lf = "linux.yml";
my $Mf = "macos.yml";
my $Wf = "windows.yml";

my $Lstr = get-file-content($Lf);
my $Mstr = get-file-content($Mf);
my $Wstr = get-file-content($Wf);

my $Lfil = "$modpdir/.github/workflows/$Lf";
my $Mfil = "$modpdir/.github/workflows/$Mf";
my $Wfil = "$modpdir/.github/workflows/$Wf";

spurt $Lfil, $Lstr;
spurt $Mfil, $Mstr;
spurt $Wfil, $Wstr;

# remove the existing test.yml file
my $unwanted = "$modpdir/.github/workflows/test.yml";
unlink $unwanted if $unwanted.IO.e;

# mod the dist.ini file. add ALL optional sections recognized by App::Mi6

my $distfil = "$modpdir/dist.ini";
Expand Down
30 changes: 30 additions & 0 deletions resources/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linux

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- ubuntu-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Install Dependencies
run: |
zef install --/test --deps-only .
zef install --/test App::Prove6
- name: Run Tests
run: prove6 -l t
30 changes: 30 additions & 0 deletions resources/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: MacOS

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- macos-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Install Dependencies
run: |
zef install --/test --deps-only .
zef install --/test App::Prove6
- name: Run Tests
run: prove6 -l t
31 changes: 31 additions & 0 deletions resources/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Win64

env:
TEST_JOBS: 1

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- windows-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Raku/setup-raku@v1
- name: Install Dependencies
run: |
choco install rakudostar
zef --exclude="z" install --debug --/test --test-depends --deps-only .
- name: Run Tests
run: zef install . --debug

0 comments on commit cf06858

Please sign in to comment.