Commit Graph

418 Commits

Author SHA1 Message Date
MDW
0394c2bea9 Qual: disable PHPCS action (now performed by pre-commit) (#28097)
# Qual: disable PHPCS action (now performed by pre-commit)

The php-cs analysis is now ensured by pre-commit which does analysis
on changed files in PR's and full analysis in the main branches.

It also provides better reports (PHPCS did not report all the issues
seen in travis).
2024-02-09 18:57:27 +01:00
MDW
828496776b Qual: pre-commit: run phpcs on all files in 'main' branches. (#28018) (#28067)
This change to the workflow will run phpcs on all files in develop,
17.0, 18.0, ... (rule== branch ends in .0).

This ensures that phpcs is run in a github workflow for fast phpcs
issue detection in the develop and other main branches.

Ultimately, this means that the PHPCS action can be disabled
in branches where it is active.  But I propose to verify that
the updated action does the job as expected (tested in a fork
it is ok).

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-08 13:57:05 +01:00
Laurent Destailleur
097290fc38 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
Conflicts:
	htdocs/comm/action/peruser.php
	htdocs/core/class/commonobject.class.php
2024-02-07 18:16:57 +01:00
Laurent Destailleur
e6b165003f Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
Conflicts:
	htdocs/core/class/commonobject.class.php
2024-02-07 18:01:11 +01:00
MDW
72305a9218 Qual: pre-commit: run phpcs on all files in 'main' branches. (#28018)
This change to the workflow will run phpcs on all files in develop,
17.0, 18.0, ... (rule== branch ends in .0).

This ensures that phpcs is run in a github workflow for fast phpcs
issue detection in the develop and other main branches.

Ultimately, this means that the PHPCS action can be disabled
in branches where it is active.  But I propose to verify that
the updated action does the job as expected (tested in a fork
it is ok).
2024-02-05 13:35:20 +01:00
MDW
ed3bfb152a Qual: Backport pre-commit to 17.0 (#27948)
Backport the pre-commit tool to bring extra checks to the older versions
so that they are fixed earlier before merging in upper versions.

Other PRs will be created for backporting to 18.0 and 19.0.
The PRs should be accepted in reverse order:
- develop;
- 19.0:
- 18.0;
- 17.0.

That should avoid merge conflicts and ensure that options (and ignored
messages or steps) are adapted to the version branch.
2024-02-03 00:10:49 +01:00
Laurent Destailleur
40f18f5577 Try to use a unique id 2024-02-02 13:56:11 +01:00
MDW
4d0fbc657e Qual: Backport pre-commit to 19.0 (#27950)
* Qual: Backport pre-commit to 17.0

Backport the pre-commit tool to bring extra checks to the older versions
so that they are fixed earlier before merging in upper versions.

Other PRs will be created for backporting to 18.0 and 19.0.
The PRs should be accepted in reverse order:
- develop;
- 19.0:
- 18.0;
- 17.0.

That should avoid merge conflicts and ensure that options (and ignored
messages or steps) are adapted to the version branch.

* Qual: Backport pre-commit to 18.0

# Qual: Backport pre-commit to 18.0

Backport the pre-commit tool to bring extra checks to the older versions
so that they are fixed earlier before merging in upper versions.

Other PRs will be created for backporting to 18.0 and 19.0.
The PRs should be accepted in reverse order:
- develop;
- 19.0:
- 18.0;
- 17.0.

That should avoid merge conflicts and ensure that options (and ignored
messages or steps) are adapted to the version branch.

* Qual: Backport pre-commit to 19.0

# Qual: Backport pre-commit to 19.0

Backport the pre-commit tool to bring extra checks to the older versions
so that they are fixed earlier before merging in upper versions.

Other PRs will be created for backporting to 18.0 and 19.0.
The PRs should be accepted in reverse order:
- develop;
- 19.0:
- 18.0;
- 17.0.

That should avoid merge conflicts and ensure that options (and ignored
messages or steps) are adapted to the version branch.
2024-02-01 17:37:25 +01:00
MDW
4c077ebc4e Fix: pre-commit - install required phpcs
# Fix: pre-commit - install required phpcs
2024-01-28 16:07:43 +01:00
MDW
14b14a3b0f Add --files to pre-commit call for selected files 2024-01-28 16:07:43 +01:00
MDW
2775c78ae0 Qual: Run php-cs on changed files only with pre-commit
Use a github action to detect changed PHP files and run
php-cs on those files.
(The method suggested by the pre-commit documentation did not work).
2024-01-26 21:38:03 +01:00
MDW
7bb1e57f6c Qual: Optimize/explain workflows
# Qual: Optimize/explain workflows

phpstan checkout took about 1.5 minutes, while pre-commit only takes 10s.
So I removed the option to the checkout option which likely makes
the difference.

I removed the IMHO useless step of installing node - it may have been
useful during setting up the workflow, but not now.

I commented on the pre-commit workflow.
2024-01-21 18:00:22 +01:00
MDW
19ac1e4b02 Qual: Store phpstan cache only if not loaded or successful run
The PHPStan steps run a long time for the latest runs and I suspect that
this may be because of a bad cache, possibly includeing:
```
Result cache was not saved because of non-ignorable exception: Syntax error, unexpected } on line 378
``` .

This change should only save the cache if the run was successful or if no cache
was loaded.  The possibly preserves a cache that still reduces the run time.

For instance, the following got an empty cache, saved at 2024-01-19T21:28:22.18Z.
- https://github.com/Dolibarr/dolibarr/actions/runs/7589384926
That was an aborted run:
- https://github.com/Dolibarr/dolibarr/actions/runs/7589372703/job/20673878193

So I added `cancelled()` to avoid overwriting valid cache and phpstan cache
will only be written if the outcome was success or if the cache could not
be loaded before.

I also updated the version for the cache action.
2024-01-21 15:05:47 +01:00
Laurent Destailleur
233c52bdb2 Merge pull request #27525 from Dolibarr/dependabot/github_actions/actions/setup-node-4
Bump actions/setup-node from 3 to 4
2024-01-15 11:46:10 +01:00
Laurent Destailleur
17879abd59 Merge pull request #27524 from Dolibarr/dependabot/github_actions/actions/setup-python-5
Bump actions/setup-python from 4 to 5
2024-01-15 11:45:27 +01:00
dependabot[bot]
2ebcca7d9b Bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 05:55:59 +00:00
dependabot[bot]
f93d480e3f Bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 05:55:55 +00:00
dependabot[bot]
1473db2991 Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 05:55:52 +00:00
Laurent Destailleur
b20838077b Try to merge the 2 phpstan files 2024-01-14 19:42:54 +01:00
Laurent Destailleur
2459fe829a Fix precommit 2024-01-14 18:29:33 +01:00
Laurent Destailleur
0c202cb66d Fix precommit file 2024-01-14 18:25:44 +01:00
Laurent Destailleur
c7a19a007c Add comment 2024-01-14 18:09:32 +01:00
Laurent Destailleur
cfcde4922a Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-01-14 17:55:26 +01:00
Laurent Destailleur
7cd375bbbf Clean hooks 2024-01-14 15:01:59 +01:00
MDW
43bb558ae9 Fix: pre-commit: Skip branch check in ci (+used sed in codespell exceptions generation) (#27499)
* Use 'sed' instead of 'perl' (sed is more common)

* Skip branch check in ci
2024-01-14 15:00:01 +01:00
MDW
5bfccb7016 Qual: Add pre-commit & codespell (#27392)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-01-14 14:24:29 +01:00
MDW
5d68f1b0ee Qual: Fix line endings of yaml files for yamllint. (#27479)
# Qual: Fix line endings of yaml files for yamllint.

yamllint (included in the pre-commit setup) has some messages about the line-endings of yml files.
This fixes that.
2024-01-13 15:49:17 +01:00
MDW
c094fba538 Qual: Fix trailing whitespace in yaml file. (#27466)
# Qual: Fix trailing whitespace in yaml file.

Yaml check tools complain about trailing whitespace, so I fix them.
pre-commit (#27392) has rules to fix them automatically (locally).
2024-01-12 17:54:14 +01:00
Frédéric FRANCE
74aa353079 try to run action on push to have always valid cache (#27445) 2024-01-12 17:15:16 +01:00
Frédéric FRANCE
9aa727b420 fix phpstan action (#27388) 2024-01-10 15:41:11 +01:00
Laurent Destailleur
57385d042b Fix phpstan 2024-01-10 15:17:39 +01:00
Laurent Destailleur
f711144428 Try to move tmp dir 2024-01-10 14:52:12 +01:00
Laurent Destailleur
b8e0396303 Reduce need for github action CPU (we have a limited quota) 2024-01-10 14:48:24 +01:00
Frédéric FRANCE
8988d7b47b Update phpstan.yml 2024-01-10 14:06:16 +01:00
Frédéric FRANCE
a725b71ed1 fix phpstan action 2024-01-10 14:02:45 +01:00
Frédéric France
f8a62a401b remove can fail 2024-01-06 21:40:23 +01:00
Frédéric FRANCE
5d68744983 clean ignore 2023-12-20 18:34:02 +01:00
Frédéric FRANCE
5edaa0e704 wip 2023-12-07 21:06:36 +01:00
Frédéric FRANCE
1b6006c168 QUAL phpstan github action 2023-12-07 20:49:43 +01:00
MDW
e47811a710 QUAL Improve spelling in documentation strings/text (#26611) 2023-11-16 15:33:55 +01:00
dependabot[bot]
b0f7ebab18 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 05:08:42 +00:00
Laurent Destailleur
924da777bf Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-09-04 23:26:35 +02:00
Laurent Destailleur
750924531b Add phpcs check on github for branch v18 2023-09-04 02:44:11 +02:00
Laurent Destailleur
24d03009e9 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2023-09-04 02:38:22 +02:00
Laurent Destailleur
c3ee677256 Ignore rule 2023-09-04 02:29:15 +02:00
Laurent Destailleur
2f6f99b9c5 Disabled a duplicate github action 2023-09-01 00:12:22 +02:00
Laurent Destailleur
7ba40c9aa5 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2023-08-26 22:41:39 +02:00
Laurent Destailleur
89143099e8 Clean github actions 2023-08-26 22:41:03 +02:00
Frédéric FRANCE
0b678fa515 Update phpcs.yml 2023-08-25 14:45:07 +02:00
Frédéric FRANCE
f8ef7f7f00 Create phpcs.yml 2023-08-25 13:41:30 +02:00