[Info] Using Github Actions to Test Extensions

Discussion forum for Extension Writers regarding Extension Development.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3892
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: [Info] Using Github Actions to Test Extensions

Post by Kailey »

I'm doing something wrong :(
Annotations
1 error
Process completed with exit code 127.

EDIT: Nevermind, apparently had to set EXECUTABLE_FILES to 0.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [Info] Using Github Actions to Test Extensions

Post by david63 »

MattF wrote: Sat Dec 26, 2020 4:46 pm Once you've set up up one extension that is. I just copy the entire .github folder from one extension to another in my IDE, open the test.yml and change the EXTNAME and push it to the repo (remembering of course to delete old travis stuff too).
Yes - I know, its just the other minor adjustments to the other files that takes the time.

Any advice on the PHP8 failure?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5987
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: [Info] Using Github Actions to Test Extensions

Post by MattF »

david63 wrote: Sat Dec 26, 2020 8:11 pm Any advice on the PHP8 failure?
Ummm. I looked at some of your repos. You don't have any unit tests. You should not be running Unit tests when there is nothing to test! It wastes precious resources from Github for one, because of spooling up over 20 VMs which do nothing at all.

That PHP8 failure is happening because that combination of PHP8/PHPUnit is finally smart enough to detect when you're trying to run tests that don't exist.

If you don't have any unit or functional tests to run, the only thing worth running is the Basic checks section, which aren't really tests, but rather code inspections, via EPV and code sniffer. You need to comment out all the MySQL, Postgres and MSSQL Jobs of the workflow template we provided...until you start writing unit and functional tests, that is.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5987
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: [Info] Using Github Actions to Test Extensions

Post by MattF »

The executable files check is now merged to phpBB, so you can turn this option on.

Also the Extension Skeleton has just been updated and released with support for generating the workflow from the original post.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [Info] Using Github Actions to Test Extensions

Post by david63 »

Thanks again Matt for your work on this - it is much appreciated
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
RMcGirr83
Former Team Member
Posts: 22061
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [Info] Using Github Actions to Test Extensions

Post by RMcGirr83 »

Ditto to what David said. Very much appreciated Matt.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5987
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: [Info] Using Github Actions to Test Extensions

Post by MattF »

Those of you who utilize Code Coverage can take a look at how I utilized it for the phpBB Ads extension here:

https://github.com/phpbb-extensions/ad- ... t/pull/161

Image

I chose CodeCov.io because our previous code coverage service from Scrutinizer wouldn't communicate with GitHub Actions. I liked CodeCov as they actually had GitHub Action scripts which make sending the test reports to them much easier. It's also a good idea to enable CodeCov's Github integrations.

I'm now using CodeCov with all of my personal extensions. As for phpBB official extensions it is being used with Ad Management and Collapsible Categories right now.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
Skouat
Code Contributor
Posts: 1055
Joined: Mon Mar 10, 2008 5:30 pm
Location: France

Re: [Info] Using Github Actions to Test Extensions

Post by Skouat »

Hi,

Thanks for this guide

I spotted a typo error on
MattF wrote: Thu Dec 24, 2020 8:19 pm

Code: Select all

[![Build Status](https://github.com/GITHUB-USERNAME/REPO-NAME/workflows/Tests/badge.svg)](https://github.com/phpbb-extensions/GITHUB-USERNAME/REPO-NAME)
phpbb-extensions/ should be removed from the URL.
martec
Registered User
Posts: 324
Joined: Sat Sep 19, 2009 2:15 pm

Re: [Info] Using Github Actions to Test Extensions

Post by martec »

Hi,

thanks for this tutorial.

I created copy of repository on github to do test.
And I need help to solve the issues.
test.yml is exactly same of first post this tutorial with EXTNAME change.

Image

PHP 7.4 - mysql:5.7 and PHP 8.0 - mysql:5.7: cancelled.
PHP 8.1 - mysql:5.7 failed.

All other succeeded. (PHP 8.1 - mysql:5.7 failed. but this is because of this viewtopic.php?p=15647011#p15647011)

Error message:

PHP 7.4 - mysql:5.7
Image

PHP 8.0 - mysql:5.7
Image

if anyone knows the reason for the cancelled error, and how to resolve it I will be very grateful.
Skouat
Code Contributor
Posts: 1055
Joined: Mon Mar 10, 2008 5:30 pm
Location: France

Re: [Info] Using Github Actions to Test Extensions

Post by Skouat »

@martec

Read this post ;)
martec
Registered User
Posts: 324
Joined: Sat Sep 19, 2009 2:15 pm

Re: [Info] Using Github Actions to Test Extensions

Post by martec »

Skouat wrote: Sat Jan 30, 2021 9:31 am @martec

Read this post ;)
thanks...
but i asked about reason of cancelled.
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1304
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo

Re: [Info] Using Github Actions to Test Extensions

Post by AlfredoRamos »

martec wrote: Sat Jan 30, 2021 5:08 am if anyone knows the reason for the cancelled error, and how to resolve it I will be very grateful.
By default, GitHub Actions have the option fail-fast enabled, which is the one that cancels all steps from the same job if any step fails.

For me it's actually a good thing, since you are not wasting time for the pass/fail status or build minutes (for private repositories) when some tests do not pass.

You can disable it, like:

Code: Select all

jobs:
  mysql-tests:
    ...
    strategy:
      fail-fast: false
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
martec
Registered User
Posts: 324
Joined: Sat Sep 19, 2009 2:15 pm

Re: [Info] Using Github Actions to Test Extensions

Post by martec »

AbaddonOrmuz wrote: Sat Jan 30, 2021 9:39 pm By default, GitHub Actions have the option fail-fast enabled, which is the one that cancels all steps from the same job if any step fails.

For me it's actually a good thing, since you are not wasting time for the pass/fail status or build minutes (for private repositories) when some tests do not pass.

You can disable it, like:

Code: Select all

jobs:
  mysql-tests:
    ...
    strategy:
      fail-fast: false
very thanks. :)
so it was canceled by the fails in 8.0 and not by the fails on my part or the code.

and thanks too about how disable fail-fast.
martec
Registered User
Posts: 324
Joined: Sat Sep 19, 2009 2:15 pm

Re: [Info] Using Github Actions to Test Extensions

Post by martec »

the day I asked the question it was working. And today it seems that it is no longer working because of a "expire key sign".
Do I need to do anything or just wait for a resolution?

Image
martec
Registered User
Posts: 324
Joined: Sat Sep 19, 2009 2:15 pm

Re: [Info] Using Github Actions to Test Extensions

Post by martec »

16 days ago all ok
Image

now today...
Image

Code: Select all

mysqli_sql_exception: Table 'phpbb_tests.phpbb_config' doesn't exist in /home/runner/work/Rin-Editor_for_phpBB/Rin-Editor_for_phpBB/phpBB3/phpBB/phpbb/db/driver/mysqli.php:193
Table 'phpbb_tests.phpbb_config' doesn't exist ?
sorry for noob question. But I have no idea how to solve this.

Ps. I did not make any changes to the files inside of folder "tests"

Return to “Extension Writers Discussion”