--- /dev/null
+{
+ "problemMatcher": [
+ {
+ "owner": "perl-critic",
+ "severity": "warning",
+ "pattern": [
+ {
+ "regexp": "^(.*): (.*) at line (\\d+), column (\\d+)\\. (.*)\\. \\(Severity: \\d\\)$",
+ "file": 1,
+ "line": 3,
+ "column": 4,
+ "message": 2,
+ "code": 5
+ }
+ ]
+ },
+ {
+ "owner": "perl-critic-fail",
+ "pattern": [
+ {
+ "regexp": "^(.*): (.*)\\. \\(Severity: \\d\\)$",
+ "file": 1,
+ "message": 2
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "problemMatcher": [
+ {
+ "owner": "perl-warning",
+ "severity": "warning",
+ "pattern": [
+ {
+ "regexp": "^([*] )?(.*) at (.*) line (\\d+)\\.$",
+ "file": 3,
+ "line": 4,
+ "message": 2
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "problemMatcher": [
+ {
+ "owner": "script-error",
+ "pattern": [
+ {
+ "regexp": ": Error in script ",
+ },
+ {
+ "regexp": "^([*] )?(.*) at (.*) line (\\d+)\\.$",
+ "file": 3,
+ "line": 4,
+ "message": 2
+ }
+ ]
+ }
+ ]
+}
pull_request:
name: Check Script
env:
- apt_build_deps: irssi-git-an cpanminus elinks zsh
+ apt_build_deps: irssi-git-an irssi-python3 cpanminus elinks flake8 zsh
apt_script_deps: libdb-dev libaspell-dev libgirepository1.0-dev gobject-introspection gir1.2-notify-0.7 xosd-bin wbritish
USE_ARTEFACTS_CACHE: yes
EXTRACT_TEST_ARTEFACTS: yes
PERL_MM_NONINTERACTIVE: 1
jobs:
- skip:
- runs-on: ubuntu-latest
- outputs:
- skip: ${{ steps.ci-skip-step.outputs.ci-skip }}
- skip-not: ${{ steps.ci-skip-step.outputs.ci-skip-not }}
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 0
- - id: ci-skip-step
- uses: mstachniuk/ci-skip@v1
test:
- needs: skip
- if: ${{ needs.skip.outputs.skip == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- - uses: mstachniuk/ci-skip@v1
- with:
- fail-fast: true
- name: prepare required software
run: |
RELEASE=$(lsb_release -rs)
curl -fsSL https://download.opensuse.org/repositories/home:ailin_nemui:irssi-git-an/xUbuntu_$RELEASE/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_ailin_nemui_irssi-git-an.gpg > /dev/null
sudo apt -q update
sudo apt -q install $apt_build_deps $apt_script_deps
- - name: check Perl ver
- id: perl-ver
+ - name: Setup flake8 annotations
+ uses: rbialon/flake8-annotations@master
+ if: ${{ github.event_name == 'pull_request' }}
+ - name: Setup local annotations
+ if: ${{ github.event_name == 'pull_request' }}
+ run: |
+ for pm in "$PWD"/.github/pm-*.json; do
+ echo "::add-matcher::$pm"
+ done
+ - name: check versions
+ id: ver
run: |
- echo ::set-output name=perl_version::$(perl -e'print $^V')
+ echo "perl_version=$(perl -e'print $^V')" | tee -a "$GITHUB_OUTPUT"
+ echo "python_version=$(python3 -c 'import platform; print(platform.python_version())')" | tee -a "$GITHUB_OUTPUT"
+ echo "irssi_version=$(irssi --version | awk '{print $2}')" | tee -a "$GITHUB_OUTPUT"
- name: cache cpan
- uses: actions/cache@v2
+ uses: actions/cache@main
with:
path: |
~/extlib
- key: ${{ runner.os }}-${{ steps.perl-ver.outputs.perl_version }}-cpan-${{ github.sha }}-${{ github.run_number }}
+ key: ${{ runner.os }}-${{ steps.ver.outputs.perl_version }}-cpan-${{ github.sha }}-${{ github.run_number }}
restore-keys: |
- ${{ runner.os }}-${{ steps.perl-ver.outputs.perl_version }}-cpan-${{ github.sha }}-
- ${{ runner.os }}-${{ steps.perl-ver.outputs.perl_version }}-cpan-
+ ${{ runner.os }}-${{ steps.ver.outputs.perl_version }}-cpan-${{ github.sha }}-
+ ${{ runner.os }}-${{ steps.ver.outputs.perl_version }}-cpan-
- name: fetch origin master branch
if: ${{ github.event_name == 'pull_request' }}
run: |
- git fetch --depth=1 origin refs/heads/master
+ git fetch origin refs/heads/master
- name: configure local::lib
run: |
eval $(perl -Mlocal::lib="$HOME"/extlib)
for v in PATH PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT; do
- eval echo "\$v=\$$v" >> $GITHUB_ENV
+ eval echo "\$v=\$$v" >> "$GITHUB_ENV"
done
- name: fix the broken Encode module
run: |
if: ${{ github.event_name == 'pull_request' }}
run: |
git diff --stat origin/master
+ MARKDOWN_REPORT=1 ./_testing/report-test.zsh >> "$GITHUB_STEP_SUMMARY" || :
- name: test report
run: |
./_testing/report-test.zsh || rc=$?
- echo "SCRIPT_RC=${rc:-0}" >> $GITHUB_ENV
+ echo "SCRIPT_RC=${rc:-0}" >> "$GITHUB_ENV"
- name: integration report
run: |
./_testing/github/show-failures.zsh
- name: update scripts.yaml
- if: ${{ github.event_name == 'push' }}
run: |
perl ./_testing/update-scripts-yaml.pl
+ - name: show git changes
+ if: ${{ github.event_name == 'pull_request' }}
+ run: |
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
+ git diff | tee -a "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
- name: commit scripts.yaml
if: ${{ github.event_name == 'push' }}
run: |
-if [[ $TRAVIS == true ]] {
- . ./_testing/travis/_get_files_arr.zsh
-} \
-elif [[ -n $GITHUB_ACTION ]] {
+if [[ -n $GITHUB_ACTION ]] {
. ./_testing/github/_get_files_arr.zsh
} \
else {
if (!%info || !defined $info{name}) {
open my $ef, '>>', "perlcritic.log";
- print $ef 'No %IRSSI header in script or name not given. (Severity: 6)', "\n";
+ print $ef "scripts/$CURRENT_SCRIPT.pl: ", 'No %IRSSI header in script or name not given. (Severity: 6)', "\n";
$info{name} //= $CURRENT_SCRIPT;
}
if (!defined $version) {
open my $ef, '>>', "perlcritic.log";
- print $ef 'Missing $VERSION in script. (Severity: 6)', "\n";
+ print $ef "scripts/$CURRENT_SCRIPT.pl: ", 'Missing $VERSION in script. (Severity: 6)', "\n";
}
else {
$info{version} = $version;
$info{modules} = \@modules if @modules;
$info{commands} = \@commands if @commands;
$info{default_package} = $package =~ s/::$//r if $package;
+$info{language} = 'Perl';
YAML::Tiny::DumpFile("info.yml", [\%info]);
Irssi::command('^window log off');
--- /dev/null
+use strict;
+use warnings;
+
+my $CURRENT_SCRIPT = $ENV{CURRENT_SCRIPT};
+my $PWD = $ENV{PWD};
+my $SWD = "$PWD/../..";
+
+require YAML::Tiny;
+YAML::Tiny->VERSION("1.59");
+require Encode;
+die "Broken Encode version (2.88)" if $Encode::VERSION eq '2.88';
+{
+ # This is an ugly hack to be `lax' about the encoding. We try to
+ # read everything as UTF-8 regardless of declared file encoding
+ # and fall back to Latin-1.
+ my $orig = YAML::Tiny->can("_has_internal_string_value") || die("Error in ".__PACKAGE__);
+ no warnings 'redefine';
+ *YAML::Tiny::_has_internal_string_value = sub {
+ my $ret = $orig->(@_);
+ use bytes;
+ $_[0] = Encode::decode_utf8($_[0], sub{pack 'U', +shift})
+ unless Encode::is_utf8($_[0]);
+ $ret
+ }
+}
+
+my %existing_commands;
+my (%info, $version, $package, @commands);
+Irssi::command_bind('_irssi_test_py_cb' => sub {
+ my ($data, $server, $witem) = @_;
+ use JSON::PP;
+ my $doc = decode_json("$data");
+ eval { %info = %{$doc->{'IRSSI'}} };
+ eval { $version = $doc->{'VERSION'} };
+ eval { $package = $doc->{'package'} };
+ @commands = sort grep { !$existing_commands{$_} } map { $_->{cmd} } Irssi::commands;
+ });
+
+%existing_commands = map { ($_->{cmd} => 1) } Irssi::commands;
+
+Irssi::command('^window log on');
+Irssi::command("py load $CURRENT_SCRIPT");
+
+unless (defined $package) {
+ my %fail = (failed => 1, name => $CURRENT_SCRIPT);
+ YAML::Tiny::DumpFile("failed.yml", [\%fail]);
+ # TODO: Grep for the code instead
+}
+delete $info{''};
+for my $rb (keys %info) {
+ delete $info{$rb} unless defined $info{$rb};
+}
+
+if (!%info || !defined $info{name}) {
+ open my $ef, '>>', "perlcritic.log";
+ print $ef "scripts/$CURRENT_SCRIPT.py: ", 'No IRSSI header in script or name not given. (Severity: 6)', "\n";
+ $info{name} //= $CURRENT_SCRIPT;
+}
+if (!defined $version) {
+ open my $ef, '>>', "perlcritic.log";
+ print $ef "scripts/$CURRENT_SCRIPT.py: ", 'Missing __version__ in script. (Severity: 6)', "\n";
+}
+else {
+ $info{version} = $version;
+}
+chomp(my $loginfo = `git log 2d0759e6... -1 --format=%ai -- "$SWD/scripts/$CURRENT_SCRIPT.py" 2>/dev/null ||
+git log -1 --format=%d%m%ai -- "$SWD/scripts/$CURRENT_SCRIPT.py" | grep -v grafted | cut -d'>' -f2`);
+if ($loginfo) {
+ my ($date, $time) = split ' ', $loginfo;
+ $info{modified} = "$date $time";
+}
+#$info{modules} = \@modules if @modules;
+$info{commands} = \@commands if @commands;
+$info{default_package} = $package if $package;
+$info{language} = 'Python';
+YAML::Tiny::DumpFile("info.yml", [\%info]);
+Irssi::command('^window log off');
- description
- license
# optional
+ - language
- url
- commands
- note
-filelist=(scripts/*.pl)
+script_pattern='^scripts/.*\.\(pl\|py\)$'
+OIFS=$IFS; IFS=$'\n'
+filelist=($(find scripts -type f | grep $script_pattern))
+IFS=$OIFS
if [[ $GITHUB_REF != refs/heads/master ]] {
local -a scriptfiles
OIFS=$IFS; IFS=$'\n'
- scriptfiles=($(git diff --numstat --no-renames origin/master|cut -f3|grep '^scripts/.*\.pl'))
+ scriptfiles=($(git diff --numstat --no-renames origin/master | cut -f3 | grep $script_pattern))
IFS=$OIFS
if [[ $#scriptfiles -gt 0 ]] {
filelist=($scriptfiles)
elif [[ $USE_ARTEFACTS_CACHE = yes ]] {
local -a cache_allowed
OIFS=$IFS; IFS=$'\n'
- cache_allowed=(scripts/${^$(grep -v __ARTEFACTS_CI__ old-artefacts/can-use-cache | cut -f2- -d\ )})
+ cache_allowed=(scripts/${^$(grep -v __ARTEFACTS_CI__ old-artefacts/can-use-cache | cut -f2- -d' ')})
IFS=$OIFS
if [[ $REPORT_STAGE == yes ]] {
#!/bin/zsh
echo $(git log --format=%H -1 _testing .github) __ARTEFACTS_CI__>old-artefacts/new-changed-info
-for f (scripts/*.pl) {
+for f (scripts/*.pl(N) scripts/*.py(N)) {
echo $(git hash-object $f) ${f:t} >>old-artefacts/new-changed-info
}
grep -sxFf old-artefacts/new-changed-info old-artefacts/changed-info >old-artefacts/can-use-cache
. ./_testing/_get_files_arr.zsh
+root_script() {
+ perl -p -e 's{ at ([^/\s]*) line (\d+)}{ at scripts/$1 line $2}g'
+}
+
if [[ $GITHUB_REF != refs/heads/master ]] {
echo '======== INTEGRATION REPORT ========='
for scriptfile ($filelist) {
if [[ -f "Test/${scriptfile:t:r}/failed.yml" ]] {
echo "FATAL: SCRIPT FAILED TO LOAD "
}
- cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
- cat "Test/${scriptfile:t:r}/irssi.log"
+ cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null | root_script
+ cat "Test/${scriptfile:t:r}/irssi.log" | root_script
echo
echo 'Source code critic:'
- cat "Test/${scriptfile:t:r}/perlcritic.log"
+ cat "Test/${scriptfile:t:r}/perlcritic.log" 2>/dev/null
+ cat "Test/${scriptfile:t:r}/flake8.log" 2>/dev/null
echo
}
echo
for scriptfile ($filelist) {
if [[ -f "Test/${scriptfile:t:r}/failed.yml" ]] {
echo '--- '$scriptfile:t
- cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
- cat "Test/${scriptfile:t:r}/irssi.log"
+ cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null | root_script
+ cat "Test/${scriptfile:t:r}/irssi.log" | root_script
echo
}
}
# CRIT
if { grep -qs 'Code before strictures are enabled\|Two-argument "open" used' "Test/${scriptfile:t:r}/perlcritic.log" } { print -n ' '$failmark' ' } \
+ elif { grep -qs ': \(E9\|F63\|F7\|F82\)' "Test/${scriptfile:t:r}/flake8.log" } { print -n ' '$failmark' ' } \
elif { grep -qs 'command not found:' "Test/${scriptfile:t:r}/perlcritic.log" } { print -n ' '$skipmark' ' } \
else { print -n ' '$passmark' '; ((++pass)) }; print -n $T
# SCORE
- perl -ne '$score += $1 -1 if /Severity: (\d+)/; END { printf "%3d", $score }' "Test/${scriptfile:t:r}/perlcritic.log" 2>/dev/null
+ perl -ne 'BEGIN { @fl = ("E9|F63|F7|F82" => 5, "F[0-9]" => 4, "E[0-9]" => 3, "[CW][0-9]" => 2, "N[0-9]" => 1) }
+ $score += $1 -1 if /Severity: (\d+)/;
+ for ($i = 0; $i < @fl; $i += 2) { if (/\d: $fl[$i]/) { $score += $fl[$i + 1]; last } }
+ END { printf "%3d", $score }' "Test/${scriptfile:t:r}/perlcritic.log" "Test/${scriptfile:t:r}/flake8.log" 2>/dev/null
print -n ' '$T
if [[ $pass -lt 3 ]] {
- if [[ -n $allow_fail[$scriptfile:t:r] ]] || [[ ! -f scripts/${scriptfile:t:r}.pl ]] {
+ if [[ -n $allow_fail[$scriptfile:t:r] ]] || { [[ ! -f scripts/${scriptfile:t:r}.pl ]] && [[ ! -f scripts/${scriptfile:t:r}.py ]] } {
print -n ' '$skipmark' '
} \
else {
#!/bin/zsh
local base_path="`pwd`"
local test_script="$base_path/_testing/_irssi_test.pl"
+local test_script_py="$base_path/_testing/_irssi_test_py.pl"
if [[ $(perl -MEncode -e'print $Encode::VERSION') == 2.88 ]] {
echo "Broken Encode version (2.88). Please update the Perl Encode module."
. ./_testing/_get_files_arr.zsh
-for scriptfile ($filelist) {
- rm -rf "Test/${scriptfile:t:r}"
- mkdir -p "Test/${scriptfile:t:r}"
- if [[ ! -f scripts/${scriptfile:t:r}.pl ]] {
- {echo "command not found: script ${scriptfile:t:r}";echo "test skipped"} >"Test/${scriptfile:t:r}/perlcritic.log"
- continue
- }
- perlcritic --theme certrule --exclude RequireEndWithOne -2 scripts/${scriptfile:t:r}.pl >"Test/${scriptfile:t:r}/perlcritic.log" 2>&1
- pushd Test
- rm -fr .home
- mkdir .home
- ln -s ../../scripts .home
- local filename="$base_path/$scriptfile"
- <<STARTUP>.home/startup
-^set settings_autosave off
+COMMON_STARTUP='^set settings_autosave off
^set use_status_window off
^set autocreate_windows off
^set -clear autocreate_query_level
^load irc
^load dcc
^load flood
-^load notifylist
-^load perl
-^load otr
-^script exec \$\$^W = 1
-run ${(qqq)test_script}
-^quit
-STARTUP
+^load notifylist'
+
+test_common() {
pushd ${scriptfile:t:r}
env TERM=xterm CURRENT_SCRIPT="$scriptfile:t:r" irssi --home="$base_path/Test/.home" >/dev/null 2>stderr.log
if [[ ! -s stderr.log ]] { rm -f stderr.log }
echo /$scriptfile >&2
}
popd
+ perl -i -pe '
+s,\Q$ENV{PWD}/Test/.home/scripts/\E,,g;
+s,\Q$ENV{PWD}/Test/.home\E,..,g;
+s,\Q$ENV{PWD}\E,...,g;
+s,\(\@INC contains: .*?\),,g' "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
logs=(~/irc.log.*(N))
if [[ $#logs -gt 0 ]] {
- perl -i -pe 's,\Q$ENV{PWD}/Test/.home/scripts/\E,,g;s,\Q$ENV{PWD}/Test/.home\E,..,g;s,\Q$ENV{PWD}\E,...,g;s,\(\@INC contains: .*?\),,g' $logs
+ perl -i -pe '
+s,\Q$ENV{PWD}/Test/.home/scripts/\E,,g;
+s,\Q$ENV{PWD}/Test/.home\E,..,g;
+s,\Q$ENV{PWD}\E,...,g;
+s,\(\@INC contains: .*?\),,g' $logs
mv $logs "Test/${scriptfile:t:r}/irssi.log"
} \
elif [[ -f stderr.log ]] {
cat stderr.log
}
}
+
+test_perl() {
+ perlcritic --theme certrule --exclude RequireEndWithOne -2 --verbose 5 scripts/${scriptfile:t:r}.pl >"Test/${scriptfile:t:r}/perlcritic.log" 2>&1
+ pushd Test
+ rm -fr .home
+ mkdir .home
+ ln -s ../../scripts .home
+ local filename="$base_path/$scriptfile"
+ <<STARTUP>.home/startup
+$COMMON_STARTUP
+^load perl
+^load otr
+^script exec \$\$^W = 1
+run ${(qqq)test_script}
+^quit
+STARTUP
+ test_common
+}
+
+test_python() {
+ flake8 --exit-zero --max-complexity=10 --max-line-length=127 --statistics --show-source scripts/${scriptfile:t:r}.py >"Test/${scriptfile:t:r}/flake8.log" 2>&1
+ pushd Test
+ rm -fr .home
+ mkdir .home
+ mkdir .home/scripts
+ cat ../scripts/${scriptfile:t:r}.py > .home/scripts/${scriptfile:t:r}.py
+ <<CB>>.home/scripts/${scriptfile:t:r}.py
+
+# added by run-test.zsh for _irssi_test_py.pl
+import json as __test_json
+import irssi as __test_irssi
+__test_irssi.command(b'^_irssi_test_py_cb ' + __test_json.dumps({'IRSSI': globals().get('IRSSI'), 'VERSION': globals().get('__version__'), 'package': globals().get('__name__')}).encode('utf-8'))
+
+CB
+ local filename="$base_path/$scriptfile"
+ <<STARTUP>.home/startup
+$COMMON_STARTUP
+^load perl
+^load python
+^load otr
+run ${(qqq)test_script_py}
+^quit
+STARTUP
+ test_common
+}
+
+for scriptfile ($filelist) {
+ if [[ -f scripts/${scriptfile:t:r}.pl ]] && [[ -f scripts/${scriptfile:t:r}.py ]] {
+ echo "cannot have both ${scriptfile:t:r}.pl and ${scriptfile:t:r}.py" >&2
+ exit 1
+ }
+ rm -rf "Test/${scriptfile:t:r}"
+ mkdir -p "Test/${scriptfile:t:r}"
+ if [[ -f scripts/${scriptfile:t:r}.pl ]] {
+ test_perl
+ } \
+ elif [[ -f scripts/${scriptfile:t:r}.py ]] {
+ test_python
+ } \
+ else {
+ {echo "command not found: script ${scriptfile:t:r}";echo "test skipped"} >"Test/${scriptfile:t:r}/perlcritic.log"
+ continue
+ }
+}
exit 0
+++ /dev/null
-filelist=(scripts/*.pl)
-if [[ $TRAVIS_PULL_REQUEST != false ]] {
- local -a scriptfiles
- OIFS=$IFS; IFS=$'\n'
- scriptfiles=($(git diff --numstat --no-renames $TRAVIS_BRANCH|cut -f3|grep '^scripts/.*\.pl'))
- IFS=$OIFS
- if [[ $#scriptfiles -gt 0 ]] {
- filelist=($scriptfiles)
- }
-} \
-elif [[ $USE_ARTEFACTS_CACHE = yes ]] {
- local -a cache_allowed
- OIFS=$IFS; IFS=$'\n'
- cache_allowed=(scripts/${^$(grep -v __ARTEFACTS_CI__ old-artefacts/can-use-cache | cut -f2- -d\ )})
- IFS=$OIFS
-
- if [[ $REPORT_STAGE == yes ]] {
- autoload -Uz zargs
- mkdir -p Test
- { zargs -r -- old-artefacts/Test/${^cache_allowed:t:r} -- mv -nt Test } 2>/dev/null
- cached_run=($cache_allowed)
- } \
- else {
- # is-at-least 5.0.0
- filelist=(${filelist:|cache_allowed})
- }
-}
+++ /dev/null
-#!/bin/zsh
-
-[[ -z $REPO_LOGIN_TOKEN ]] && exit
-[[ -z $TRAVIS_REPO_SLUG ]] && exit
-
-echo "https://${REPO_LOGIN_TOKEN}:x-oauth-basic@github.com" > "$HOME/.git-credentials"
-
-git config user.email "scripts@irssi.org"
-git config user.name "Irssi Scripts Helper"
-git config credential.helper store
-git config remote.origin.url "https://github.com/$TRAVIS_REPO_SLUG"
-git checkout "$TRAVIS_BRANCH"
-
-if [[ "$(git log -1 --format=%an)" != "$(git config user.name)" &&
- "$(git log -1 --format=%cn)" != "$(git config user.name)" ]] {
- git add _data/scripts.yaml
- git commit -m "automatic scripts database update for $TRAVIS_COMMIT
-
-[skip ci]"
- git config push.default simple
- git push origin
-}
+++ /dev/null
-#!/bin/zsh
-if [[ -z $REPO_LOGIN_TOKEN || -z $TRAVIS_REPO_SLUG ]] { exit 1 }
-autoload -Uz zargs
-
-if { ! git clone -b ci-artefacts https://github.com/$TRAVIS_REPO_SLUG artefacts } {
- mkdir artefacts && git init artefacts
- pushd artefacts
- git remote add origin https://github.com/$TRAVIS_REPO_SLUG
- git checkout -b ci-artefacts
- popd
-}
-
-pushd artefacts
-git config user.email "scripts@irssi.org"
-git config user.name "Irssi Scripts Helper"
-git config credential.helper store
-
-git rm -qrf .
-
-echo "This branch stores the travis-ci results for $TRAVIS_REPO_SLUG
-See [the testing read-me](../master/_testing/) for details." > README.markdown
-pushd ..
-MARKDOWN_REPORT=1 ./_testing/report-test.zsh >> artefacts/README.markdown
-popd
-echo >> README.markdown
-echo "$TRAVIS_COMMIT | $TRAVIS_BUILD_NUMBER" >> README.markdown
-
-mv ../Test .
-rm -fr Test/.home
-zargs -r -- Test/*/passed(N) -- rm
-if [[ $USE_ARTEFACTS_CACHE == yes ]] {
- mv ../old-artefacts/new-changed-info changed-info
-}
-
-git add .
-git commit -q -m "ci artefacts for $TRAVIS_COMMIT
-
-[skip ci]"
-
-git push -u origin ci-artefacts
+++ /dev/null
-#!/bin/zsh
-if { ! git clone -q --depth 1 -b ci-artefacts git://github.com/$TRAVIS_REPO_SLUG.git old-artefacts } {
- mkdir old-artefacts
-}
-echo $(git log --format=%H -1 _testing .travis.yml) __ARTEFACTS_CI__>old-artefacts/new-changed-info
-for f (scripts/*.pl) {
- echo $(git hash-object $f) ${f:t} >>old-artefacts/new-changed-info
-}
-grep -sxFf old-artefacts/new-changed-info old-artefacts/changed-info >old-artefacts/can-use-cache
-if { ! grep -q __ARTEFACTS_CI__ old-artefacts/can-use-cache } {
- :>|old-artefacts/can-use-cache
-}
+++ /dev/null
-#!/bin/zsh
-
-. ./_testing/_get_files_arr.zsh
-
-if [[ $TRAVIS_PULL_REQUEST != false ]] {
- echo '======== INTEGRATION REPORT ========='
- for scriptfile ($filelist) {
- echo '--- '$scriptfile:t
- if [[ -f "Test/${scriptfile:t:r}/failed.yml" ]] {
- echo "FATAL: SCRIPT FAILED TO LOAD "
- }
- cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
- cat "Test/${scriptfile:t:r}/irssi.log"
- echo
- echo 'Source code critic:'
- cat "Test/${scriptfile:t:r}/perlcritic.log"
- echo
- }
- echo
- echo '======== YAML DATABASE ========'
- for scriptfile ($filelist) {
- if [[ ! -f "Test/${scriptfile:t:r}/failed.yml" ]] {
- cat "Test/${scriptfile:t:r}/info.yml"
- }
- }
-} \
-else {
- echo '============= DETAILED FAILURE REPORTS ============='
- for scriptfile ($filelist) {
- if [[ -f "Test/${scriptfile:t:r}/failed.yml" ]] {
- echo '--- '$scriptfile:t
- cat "Test/${scriptfile:t:r}/stderr.log" 2>/dev/null
- cat "Test/${scriptfile:t:r}/irssi.log"
- echo
- }
- }
-}
}
my %newmeta;
-for my $file (<scripts/*.pl>) {
- my ($filename, $base) =
- $file =~ m,^scripts/((.*)\.pl)$,;
+for my $file (<scripts/*.pl scripts/*.py>) {
+ my ($filename, $base, $ext) =
+ $file =~ m,^scripts/((.*)\.(pl|py))$,;
my $info_file = "Test/$base/info.yml";
my @cdoc;
if (-f $info_file && open my $ef, '<:utf8', $info_file) {
<dt>How do I submit a script to this page?</dt>
<dd>See information on how to contribute <a href="https://github.com/irssi/scripts.irssi.org">here</a>.</dd>
+
+ <dt><span class="bg-danger text-danger" style="display: inline-block; padding: 0 2px; border-radius: 4px">Important.
+ </span> Python script support on this page is experimental.</dt>
+ <dd>For .py scripts, the <a href="//irssi.org/modules/#scripting-languages"><code>irssi-python3</code>
+ module</a> needs to be installed. To run them, use
+ <code><b>/py</b> load <i>scriptname</i></code> .</dd>
</dl>
<h4>Manual instructions for using scripts</h4>
<dl class="manual-instructions">
<dt>How do I submit a script to this page?</dt>
<dd>See information on how to contribute <a href="https://github.com/irssi/scripts.irssi.org">here</a>.</dd>
+
+ <dt><span class="bg-danger text-danger" style="display: inline-block; padding: 0 2px; border-radius: 4px">Important.
+ </span> Python script support on this page is experimental.</dt>
+ <dd>For .py scripts, the <a href="//irssi.org/modules/#scripting-languages"><code>irssi-python3</code>
+ module</a> needs to be installed. To run them, use
+ <code><b>/py</b> load <i>scriptname</i></code> .</dd>
</dl>
</div>
<hr>