diff --git a/.github/workflows/prove.yml b/.github/workflows/prove.yml index 68e91a1d9..d625a6336 100644 --- a/.github/workflows/prove.yml +++ b/.github/workflows/prove.yml @@ -17,11 +17,6 @@ jobs: install-modules-with: cpanm install-modules-args: --no-interactive -v --installdeps - #- name: Install deps via cpanm - #run: | - #cpanm --notest --no-interactive -v --installdeps . - #cpanm --notest --no-interactive -v Devel::Cover::Report::Clover - #cpanm --no-interactive -v Storable - name: install fhem via deb package run: | wget -qO - http://debian.fhem.de/archive.key | sudo apt-key add - @@ -34,25 +29,26 @@ jobs: # uses: mxschmitt/action-tmate@v1 - name: run prove on perl modules (testscripts) run: | - prove -j2 --exec 'perl -MDevel::Cover=-silent,1 -I FHEM ' -I FHEM -r -v t/SD_Protoco* - - name: Create clover report - run: cover -report clover - - uses: codecov/codecov-action@v3.1.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./cover_db/clover.xml - flags: unittests,perl,modules - name: perl modules (testscripts) ${{ matrix.perl }} + echo "::remove-matcher owner=perl::" + prove -j3 --exec 'perl -MDevel::Cover=-silent,1 -I FHEM ' -I FHEM -r -v t/SD_Protoco* > >(tee -a ${GITHUB_WORKSPACE}/testOutput.stdout) 2> >(tee -a ${GITHUB_WORKSPACE}/testOutput.stderr >&2) - name: run prove fhem testsuite ${{ matrix.perl }} run: | cp -R ${GITHUB_WORKSPACE}/FHEM/* ${FHEM_DIR}/FHEM/ cp -R ${GITHUB_WORKSPACE}/lib/* ${FHEM_DIR}/lib/ - #find ${GITHUB_WORKSPACE}/t/FHEM -maxdepth 1 -regex '.*/t/FHEM/[0-9][0-9]_.*' -print0 | xargs -0 -I'{}' prove --exec 'perl -MDevel::Cover=-silent,1 fhem.pl -t' -I FHEM -r -vv -r "{}" - prove -j2 --exec 'perl -MDevel::Cover=-silent,1 fhem.pl -t' -I FHEM -vv -r ${GITHUB_WORKSPACE}/t/FHEM/ + prove -j3 --exec 'perl -MDevel::Cover=-silent,1 fhem.pl -t' -I FHEM -v -r ${GITHUB_WORKSPACE}/t/FHEM/ > >(tee -a ${GITHUB_WORKSPACE}/testOutput.stdout) 2> >(tee -a ${GITHUB_WORKSPACE}/testOutput.stderr >&2) working-directory: /opt/fhem/ env: FHEM_DIR: /opt/fhem - - name: Create clover report + - name: Create clover report for perl Modules + run: cover -report clover + - uses: codecov/codecov-action@v3.1.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cover_db/clover.xml + flags: unittests,perl,modules + name: perl modules (testscripts) ${{ matrix.perl }} + + - name: Create clover report for fhem tests working-directory: /opt/fhem/ run: cover -report clover - uses: codecov/codecov-action@v3.1.1 @@ -62,4 +58,19 @@ jobs: flags: unittests,fhem,modules name: fhem (testscripts) ${{ matrix.perl }} - + - uses: reviewdog/action-setup@v1 + if: always() && github.event_name == 'pull_request' + with: + reviewdog_version: latest + + - name: Run reviewdog + if: always() && github.event_name == 'pull_request' && !cancelled() + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + reviewdog \ + -name=perl-${{ matrix.perl }} \ + -reporter="github-pr-check" \ + -filter-mode="file" \ + --diff="git diff ${{ github.base_ref }}" \ + \ No newline at end of file diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 2a25ccdd3..7520a1c53 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -37,6 +37,7 @@ jobs: BRANCH_NAME: ${{ steps.extract_branch.outputs.BRANCH_NAME }} update: needs: pr_check + if: needs.pr_check.outputs.result != 'true' env: CONTROLS_FILENAME: controls_signalduino.txt runs-on: ubuntu-latest @@ -87,9 +88,14 @@ jobs: git ls-files --error-unmatch controls_signalduino.txt || git add controls_signalduino.txt git ls-files --error-unmatch CHANGED || git add CHANGED git diff --name-only --exit-code controls_signalduino.txt || git commit CHANGED controls_signalduino.txt -m "Automatic updated controls and CHANGED" || true - - name: git push - if: needs.pr_check.outputs.result != 'true' - uses: ad-m/github-push-action@v0.6.0 + #- name: git push + # if: needs.pr_check.outputs.result != 'true' + # uses: ad-m/github-push-action@v0.6.0 + # with: + # github_token: ${{ secrets.GH_TOKEN }} + # branch: ${{ steps.extract_branch.outputs.branch }} + - name: Push to branch + uses: CasperWA/push-protected@v2 with: - github_token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GH_TOKEN }} branch: ${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 2c3dc57f6..5c598f2fc 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -135,8 +135,11 @@ jobs: path: | ${{ matrix.file }} commit: + permissions: + contents: write runs-on: ubuntu-latest needs: modify + name: Commit and Push back steps: - uses: actions/checkout@v3 with: @@ -169,8 +172,28 @@ jobs: git config --global user.email "action@github.com" git config --local user.name "GitHub Action" git commit -m "Update Versiondate" -a && echo "::set-output name=status::true" || true + + - name: Wait for tests to succeed + if: ${{ steps.commit.outputs.status }} + uses: lewagon/wait-on-check-action@v1.2.0 + with: + running-workflow-name: 'Commit and Push back' + ref: ${{ github.head_ref }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 20 + allowed-conclusions: success,skipped,cancelled,neutral + - name: git push + if: ${{ steps.commit.outputs.status }} uses: ad-m/github-push-action@v0.6.0 with: github_token: ${{ secrets.GH_TOKEN }} branch: ${{ github.head_ref }} + + #- name: Push to branch + # uses: CasperWA/push-protected@v2 + # with: + # token: ${{ secrets.GH_TOKEN }} + # branch: ${{ github.head_ref }} + # #unprotect_reviews: true + diff --git a/.reviewdog.yml b/.reviewdog.yml new file mode 100644 index 000000000..e9e8790be --- /dev/null +++ b/.reviewdog.yml @@ -0,0 +1,20 @@ +runner: + perl-test2-tap: + cmd: cat testOutput.stderr + errorformat: # (optional if you use `format`) + - '%C# at %f line %l%.' + - '%E# Failed test %m' + - '%C# | %.%#' + - '%C# +-%.%#' + - '%-G%.%#' + level: error + perl-errors: + cmd: cat testOutput.stdout + errorformat: + - '%-G%m redefined at %f line %l%.%r' + - '%+Esyntax error at %f line %l%. "%m' + - '%+Z%p%m"' + - '%+E %m %.%# at %f line %l%.%#' + - '%+ZBEGIN failed%r' + - '%-Gok%.%#' + level: error diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b6636e603..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -sudo: enabled -language: perl -jobs: - include: - - perl: "5.26@cover" - - perl: "5.24@cover" - - perl: "5.18@cover" - before_script: - - cpanm List::Util --notest -cache: - directories: - - $HOME/perl5 - - $HOME/.perlbrew -env: - global: - secure: QZkNIahKdBIE/ANg04akx6MNgFItbLVSvGrR2By6rjHqrU9kllv862aVmcOjJw5/lcewEgRMgdK8ddhCKunW5HKpgW9CrkTi2GYVcmnJpw39ye7UnIIyOJM1N3YC+vWAaru+LJh8rHkXSfopKiiOjq9uTtfFCt+kngP7oIRKfPJ/7qdgKWvYpqKnqGoFoXghBWKe3V63xunILMkRVeTg+ogBOXbRy+3OU4WBIc4DsGdKOz+XkTecjLM9sdoyYLWUodLcmqwfCNGKWKwjVOaIe+859QtIoAEkclJtXunn6wYOeaumAJ+dILKZmOt4ORQxVYtVs+3W0eUl8+Z12xi6SGCenIQQGFHjxQgbjekXCiN56vf5LQUlxSEktjK67o9tq3+8VpgnPxqAgFOh4CvX4Ite3IT2+mPMegFOJavuyN/xOTuZgTe3sXDJzCfDBTQdBrb94ex/eZWZPn0M5Dkupiegh1CK6lJFVUwHpcJWb11SI2hzQRsGtPmlxDOfi48n23gVt7/bDeJS8rUlQoehF5fTVY1lMo4SZkB1Zs/ykm+NjPFg7h03j9E1msGFE/wQOZsN550GSxnpacZT9HandaxundiQHmVUfHHR54ieLxd3/xSTjqEpZcai21Oiq2ghmagGp8s+eRdNejMWLVWuHuWynFr72XU3LSXBW6YWyIc= -git: - depth: false -before_install: - - eval $(curl https://travis-perl.github.io/init) --perl --always-upgrade-modules - - perl -V - - git config --global user.email "travis@travis-ci.org" - - git config --global user.name "Travis CI" - - git config --global push.default simple - - git remote set-url origin https://${GH_API_KEY}@github.com/RFD-FHEM/RFFHEM.git - - wget -qO - http://debian.fhem.de/archive.key | sudo apt-key add - || true - - echo "deb http://debian.fhem.de/nightly/ /" | sudo tee -a /etc/apt/sources.list || true -install: - - cpanm --notest --skip-installed --installdeps . - - cpanm Storable - - sudo apt-get update -qq - - sudo apt-get install fhem -y || (curl -sLO http://fhem.de/fhem-5.9.deb && sudo apt install ./fhem-5.9.deb) - - sudo chown travis -R /opt/fhem - - sudo /etc/init.d/fhem stop - # - sudo service fhem stop -script: - - timeout 40 bash -c 'while /usr/bin/pgrep perl >> /dev/null; do sleep 1; echo .; done;' - - make test - - sudo pkill "^perl" || true - - timeout 40 bash -c 'while /usr/bin/pgrep perl >> /dev/null; do sleep 1; echo .; done;' || sudo pkill "^perl" - - sleep 3 - - cp -R /opt/fhem/cover_db ./ - - if [ "$FULL_COVER" != "true" ]; then git --no-pager diff --diff-filter=d --name-only $TRAVIS_COMMIT_RANGE | grep .pm | xargs -I@ echo -select @ | xargs cover -report coveralls; fi - - if [ "$FULL_COVER" = "true" ]; then git ls-tree --full-tree -r --name-only HEAD ./FHEM | grep .pm | xargs -I@ echo -select @ | xargs cover -report coveralls; fi -after_failure: - - UnitTest/src/report_failure.sh diff --git a/FHEM/14_SD_WS07.pm b/FHEM/14_SD_WS07.pm index b03db7994..705e6fddd 100644 --- a/FHEM/14_SD_WS07.pm +++ b/FHEM/14_SD_WS07.pm @@ -1,5 +1,5 @@ ############################################## -# $Id: 14_SD_WS07.pm 21666 2021-12-29 16:12:11Z elektron-bbs $ +# $Id: 14_SD_WS07.pm 21666 2022-10-23 12:40:10Z sidey79 $ # # The purpose of this module is to support serval eurochron # weather sensors like eas8007 which use the same protocol @@ -145,9 +145,9 @@ SD_WS07_Parse($$) } $model = $model."_".$models{$modelkey}; - my $deviceCode; - my $longids = AttrVal($iohash->{NAME},'longids',0); - if ( ($longids ne "0") && ($longids eq "1" || $longids eq "ALL" || (",$longids," =~ m/,$model,/))) { + my $deviceCode; + my $longids = AttrVal($iohash->{NAME},'longids',0); + if ( ($longids ne "0") && ($longids eq "1" || $longids eq "ALL" || (",$longids," =~ m/,$model,/))) { $deviceCode = $id.$channel; Log3 $iohash,4, "$iohash->{NAME}: using longid $longids model $model"; } else { diff --git a/controls_signalduino.txt b/controls_signalduino.txt index ea33d63e0..171fdf6c8 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -9,7 +9,7 @@ UPD 2020-10-03_11:48:15 11170 FHEM/14_SD_AS.pm UPD 2021-07-13_20:29:34 29223 FHEM/14_SD_BELL.pm UPD 2022-09-07_20:44:05 178780 FHEM/14_SD_UT.pm UPD 2022-09-11_17:07:22 130779 FHEM/14_SD_WS.pm -UPD 2021-12-30_17:02:10 18709 FHEM/14_SD_WS07.pm +UPD 2022-10-23_14:39:30 18704 FHEM/14_SD_WS07.pm UPD 2022-04-15_20:58:20 35384 FHEM/14_SD_WS09.pm UPD 2020-04-13_23:15:56 14325 FHEM/14_SD_WS_Maverick.pm UPD 2021-08-11_21:38:30 37904 FHEM/41_OREGON.pm diff --git a/t/FHEM/14_SD_WS/00_load.t b/t/FHEM/14_SD_WS/00_load.t index 29f0e10b8..b6dbc2c51 100644 --- a/t/FHEM/14_SD_WS/00_load.t +++ b/t/FHEM/14_SD_WS/00_load.t @@ -10,7 +10,7 @@ use Test2::Tools::Compare qw{ is }; my $module = basename (dirname(__FILE__)); plan(1); -is(CommandReload(undef,$module), undef, "$module loaded"); +is(CommandReload(undef,$module), U(), "$module loaded"); exit(0); # necessary