diff --git a/README.md b/README.md index 291640a..c5d1ef2 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,6 @@ Use `ddt -u deps` The documentation site describes the current practices pretty well at [https://docs.raku.org/language/modules#Distributing_modules](https://docs.raku.org/language/modules#Distributing_modules). The original design document of META6.json is available at [http://design.perl6.org/S22.html](http://design.perl6.org/S22.html). - * How do I remove the travis badge? - -Remove .travis.yml - SEE ALSO ======== diff --git a/lib/Ddt.rakumod b/lib/Ddt.rakumod index d2060d7..ae92c54 100644 --- a/lib/Ddt.rakumod +++ b/lib/Ddt.rakumod @@ -183,11 +183,6 @@ L. The original design document of META6.json is available at L. -=item How do I remove the travis badge? - -Remove .travis.yml - - =head1 SEE ALSO =item L diff --git a/lib/Ddt/Distribution.rakumod b/lib/Ddt/Distribution.rakumod index 296988c..7c39ef2 100644 --- a/lib/Ddt/Distribution.rakumod +++ b/lib/Ddt/Distribution.rakumod @@ -42,6 +42,7 @@ has $.ignore-rules = do { File::Ignore.parse: $rules; }; has IO::Path $.bin-dir = enhance-io-path-class $!main-dir.child(), $!ignore-rules; +has IO::Path $.github-workflows = $!main-dir.child(<.github>).child(); has IO::Path $.hooks-dir = $!main-dir.child(); has IO::Path $.lib-dir = enhance-io-path-class $!main-dir.child(), $!ignore-rules; has IO::Path $.test-dir = enhance-io-path-class $!main-dir.child(), $!ignore-rules; @@ -102,6 +103,7 @@ sub in-git-repo returns Bool:D { method !make-directories { $.main-dir.mkdir; + $.github-workflows.mkdir; $.bin-dir.mkdir; $.hooks-dir.mkdir; $.lib-dir.mkdir; @@ -140,15 +142,6 @@ method generate-README { { if my $markdown = self.render-markdown( $file ) { - my ($user, $repo) = self.guess-user-and-repo(); - my $header = do if $user and ".travis.yml".IO.e { - "[![Build Status](https://travis-ci.org/$user/$repo.svg?branch=master)]" - ~ "(https://travis-ci.org/$user/$repo)" - ~ "\n\n"; - } else { - ""; - } - return $.main-dir.child("README.md").spurt: $header ~ $markdown; } } @@ -197,7 +190,7 @@ method !make-content { $.test-dir.child(<00-meta.t>) test-meta $.test-dir.child(<01-basic.t>) test $.main-dir.child(<.gitignore>) gitignore - $.main-dir.child(<.travis.yml>) travis + $.github-workflows.child() github-action >>; for %map.kv -> $f, $c { spurt($f, %content{$c}); @@ -281,20 +274,6 @@ method !name-to-file(Str $module is copy) { self!to-file: $module; } -submethod guess-user-and-repo() { - my $url = self.find-source-url(); - return if $url eq ""; - if $url ~~ m{ (git|https?) '://' - [<-[/]>+] '/' - $=[<-[/]>+] '/' - $=[.+?] [\.git]? - $} { - return $/, $/; - } else { - return; - } -} - # A hack for getting identical json on each run sub meta-to-json(META6 $meta --> Str:D) { my %h = from-json($meta.to-json: :skip-null).pairs.grep: *.value !~~ Empty; diff --git a/lib/Ddt/Template.rakumod b/lib/Ddt/Template.rakumod index e09af2a..1e8571e 100644 --- a/lib/Ddt/Template.rakumod +++ b/lib/Ddt/Template.rakumod @@ -23,19 +23,37 @@ Session.vim tags EOF -travis => qq:to/EOF/, -os: - - linux - - osx -language: raku -raku: - - latest -install: - - rakubrew build-zef - - zef --/test --deps-only install . -script: - - zef test . -sudo: false +github-action => q:to/EOF/, +--- +name: Tests +on: + pull_request: + push: + schedule: + - cron: 1 1 * * 5 + workflow_dispatch: +jobs: + test: + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + - uses: Raku/setup-raku@v1 + + - name: Raku version + run: raku -v + + - name: Install dependencies + run: zef install --deps-only --/test --test-depends . + + - name: Run tests + run: zef test -v --debug . EOF test => qq:to/END_OF_TEST/, diff --git a/xt/01-actual.t b/xt/01-actual.t index 3296864..a8a76e4 100644 --- a/xt/01-actual.t +++ b/xt/01-actual.t @@ -20,7 +20,7 @@ subtest "ddt new command", { ok "Foo-Bar".IO.d, "Distribution directory is created"; chdir "Foo-Bar"; subtest "All expected files exist", { - my @expected = <.git .gitignore .travis.yml LICENSE META6.json README.md bin lib t>; + my @expected = <.git .gitignore .github/workflows/test.yaml LICENSE META6.json README.md bin lib t>; plan @expected.elems; for @expected { ok $*CWD.child($_).e, "$_ exists"