Commit Graph

14 Commits

Author SHA1 Message Date
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
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]
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
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
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