[Info] Using Github Actions to Test Extensions

Discussion forum for Extension Writers regarding Extension Development.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [Info] Using Github Actions to Test Extensions

Post by 3Di »

Disable your tests for php 8.1 for now, like phpBB does here
https://github.com/phpbb/phpbb/blob/46d ... #L126-L127
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
martec
Registered User
Posts: 324
Joined: Sat Sep 19, 2009 2:15 pm

Re: [Info] Using Github Actions to Test Extensions

Post by martec »

3Di wrote: Wed Mar 24, 2021 5:17 am Disable your tests for php 8.1 for now, like phpBB does here
https://github.com/phpbb/phpbb/blob/46d ... #L126-L127
@3Di very thanks for information!
so because of this https://tracker.phpbb.com/browse/PHPBB3-16707 and https://github.com/phpbb/phpbb/pull/6162

I thought I was doing something wrong. thanks again for the info.
User avatar
Crizzo
Translations & International Support Teams Manager
Translations & International Support Teams Manager
Posts: 1757
Joined: Thu Apr 23, 2009 1:20 pm
Location: Stuttgart, Germany
Name: Christian

Re: [Info] Using Github Actions to Test Extensions

Post by Crizzo »

I have this error
71 | ERROR | Either use statement or full name must be used.
| | (..phpbb_Sniffs_Namespaces_UnusedUse.FullName
This is pointing on my constructor or its doc block.

Edit: Solution: viewtopic.php?f=461&t=2579596
My extensions for phpBB: CDB
German phpBB Support at www.phpbb.de
User avatar
LukeWCS
Registered User
Posts: 284
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: [Info] Using Github Actions to Test Extensions

Post by LukeWCS »

I tested Github Actions today. Since I haven't used Travis in a long time, I was curious about GA. I noticed that not all tests are run in certain situations.

In particular, it concerns the tests that are carried out according to CS, i.e. ICC, EXE and EPV. I deliberately uploaded a prepared Ext, which definitely triggers errors in CS and EPV, so I always test my phpBB Ext Check. CS was always executed, but the subsequent tests never. After many attempts, I found that the tests below would not run if CS found errors.

For testing purposes, I uploaded a version of the Ext in the repo that does not trigger any errors in CS and EPV. This is where the following tests are carried out. Then I replaced a tab in a PHP file with 4 spaces and updated the repo again. Now CS reports an error and the following tests are no longer carried out, see picture.

PicPick_2021-04-23_12-39-42.png
You do not have the required permissions to view the files attached to this post.
May the backup be with you. Always.
User avatar
Prosk8er
Registered User
Posts: 1771
Joined: Sun Mar 12, 2006 3:30 am
Location: Rochester, NY
Name: Tyler

Re: [Info] Using Github Actions to Test Extensions

Post by Prosk8er »

i got rid of travis for my snowstorm lights extension https://github.com/Prosk8er/Snowstorm-Lights and i have one error is it fixable or forget about it?
You do not have the required permissions to view the files attached to this post.
User avatar
Prosk8er
Registered User
Posts: 1771
Joined: Sun Mar 12, 2006 3:30 am
Location: Rochester, NY
Name: Tyler

Re: [Info] Using Github Actions to Test Extensions

Post by Prosk8er »

for now i just did IMAGE_ICC: 0
but would still like to know if there is a fix for above error
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 6038
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 »

You need to strip the ICC profile from the image. Google it.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
Prosk8er
Registered User
Posts: 1771
Joined: Sun Mar 12, 2006 3:30 am
Location: Rochester, NY
Name: Tyler

Re: [Info] Using Github Actions to Test Extensions

Post by Prosk8er »

got it thank you matt
in adobe cc i did edit/assign profile and clicked don't color manage this document
User avatar
Toxyy
Registered User
Posts: 966
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek

Re: [Info] Using Github Actions to Test Extensions

Post by Toxyy »

Toxyy wrote: Fri Apr 23, 2021 11:18 pm Getting this error on the PHP 8.0 - mysql:5.7 test in github actions:

Code: Select all

Test directory "phpBB/ext/toxyy/anonymousposts/.github/../tests" not found
Error: Process completed with exit code 2.
This part passes in all of the other tests, I'm not sure what's wrong with the php 8 one.
Still experiencing this error:
https://github.com/toxyy/anonymousposts ... step:10:16
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28935
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier

Re: [Info] Using Github Actions to Test Extensions

Post by Paul »

Did you trying creating the tests/ directory, and putting tests in there?
User avatar
Toxyy
Registered User
Posts: 966
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek

Re: [Info] Using Github Actions to Test Extensions

Post by Toxyy »

Paul wrote: Sun Apr 10, 2022 11:16 am Did you trying creating the tests/ directory, and putting tests in there?
That was my next step, I was just unaware of if it was a bug since all tests in other php versions run fine without it, as my other extension shows:
https://github.com/toxyy/acpmergechildf ... 2101076289
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 6038
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 »

Toxyy wrote: Sun Apr 10, 2022 11:10 am
Toxyy wrote: Fri Apr 23, 2021 11:18 pm Getting this error on the PHP 8.0 - mysql:5.7 test in github actions:

Code: Select all

Test directory "phpBB/ext/toxyy/anonymousposts/.github/../tests" not found
Error: Process completed with exit code 2.
This part passes in all of the other tests, I'm not sure what's wrong with the php 8 one.
Still experiencing this error:
https://github.com/toxyy/anonymousposts ... step:10:16
viewtopic.php?p=15647011#p15647011
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
Gwyneth Llewelyn
Registered User
Posts: 60
Joined: Thu Aug 06, 2009 11:34 pm
Location: Neufreistadt, Confederation of the Democratic Simulators, Second Life
Name: Gwyneth Llewelyn

GA newbie question

Post by Gwyneth Llewelyn »

Hi there! And thanks @MattF for this outstanding job!

Please bear with me... while I've been using GitHub Actions for a while now, I'm not familiar with writing rules for these actions, thus my question...

AFAICS, the action rules presume that one's extension is at the 'root' of the GitHub repo, is that correct? Thus, if your extension is named bar, and your GitHub username is foo, these rules assume that the GitHub repo for your extension is located at https://github.com/foo/bar — right?

Now, for several reasons, I've got my own extension one level below, i.e. https://github.com/foo/project-name/bar, where the project-name is not important — it mostly allows me to have lots of things at the root that are important to me as a developer, but absolutely irrelevant for a potential end-user wanting to install the extension — and who only need to know that they should use foo/bar.

I'm aware that I could simply add half a ton of rules to .gitignore to make sure that none of the many, many files I've got on the root — and which, as said, are just related to development configuration — are ever exported to GitHub, or packaged in the zip file, but... it seems like a very awkward way of doing things, IMHO. Developers need all those configuration thingies. End-users do not. You cannot create a rule for one and a different one for the other type of user. You can, however, dump the whole mess inside the root, not .gitignore it — so that developers will be able to get all those files when cloning the repo — but keep all those files off the zip file.

I can't quite understand where exactly in the action rules that is being handled. To me, it looks like GitHub will simply package all the mess together inside the zip file, and that's it. After all, the extension will run, mess or no mess...

Additionally, for some very stupid reason, when I first registered with GitHub eons ago, I used CamelCase for my name, while the phpBB convention for names & extensions is now all-lowercase. I have some degree of control over that on subfolders, obviously, but I cannot change anything on the GitHub side of things (even though, AFAIK, GitHub's usernames are case-insensitive, e.g. they accept all-lowercase as the actual username, redirecting to the proper repo anyway — but that might only happen at the HTTP level when accessing repos via a browser, I don't really know).

So... my question is simply... what would I need to change on the workflow file to have it working on subfolders as well? On the official documentation page, there is a reference to "changes to be made" but it's not specified which changes have to be made and where...
I'm just a virtual girl in a virtual world...
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 6038
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: GA newbie question

Post by MattF »

Gwyneth Llewelyn wrote: Wed Apr 24, 2024 8:57 pm Hi there! And thanks @MattF for this outstanding job!

Please bear with me... while I've been using GitHub Actions for a while now, I'm not familiar with writing rules for these actions, thus my question...

AFAICS, the action rules presume that one's extension is at the 'root' of the GitHub repo, is that correct? Thus, if your extension is named bar, and your GitHub username is foo, these rules assume that the GitHub repo for your extension is located at https://github.com/foo/bar — right?

Now, for several reasons, I've got my own extension one level below, i.e. https://github.com/foo/project-name/bar, where the project-name is not important — it mostly allows me to have lots of things at the root that are important to me as a developer, but absolutely irrelevant for a potential end-user wanting to install the extension — and who only need to know that they should use foo/bar.

I'm aware that I could simply add half a ton of rules to .gitignore to make sure that none of the many, many files I've got on the root — and which, as said, are just related to development configuration — are ever exported to GitHub, or packaged in the zip file, but... it seems like a very awkward way of doing things, IMHO. Developers need all those configuration thingies. End-users do not. You cannot create a rule for one and a different one for the other type of user. You can, however, dump the whole mess inside the root, not .gitignore it — so that developers will be able to get all those files when cloning the repo — but keep all those files off the zip file.

I can't quite understand where exactly in the action rules that is being handled. To me, it looks like GitHub will simply package all the mess together inside the zip file, and that's it. After all, the extension will run, mess or no mess...

Additionally, for some very stupid reason, when I first registered with GitHub eons ago, I used CamelCase for my name, while the phpBB convention for names & extensions is now all-lowercase. I have some degree of control over that on subfolders, obviously, but I cannot change anything on the GitHub side of things (even though, AFAIK, GitHub's usernames are case-insensitive, e.g. they accept all-lowercase as the actual username, redirecting to the proper repo anyway — but that might only happen at the HTTP level when accessing repos via a browser, I don't really know).

So... my question is simply... what would I need to change on the workflow file to have it working on subfolders as well? On the official documentation page, there is a reference to "changes to be made" but it's not specified which changes have to be made and where...
Try using sparse-mode with the Checkout extension step

Code: Select all

- name: Checkout extension
  uses: actions/checkout@v4
  with:
      path: phpBB3/phpBB/ext/${{ env.EXTNAME }}
      sparse-checkout: 'project-name/bar'
      sparse-checkout-cone-mode: false
Formerly known as VSEMy ExtensionsPlease do not PM me for support.

Return to “Extension Writers Discussion”