Commit Graph

45 Commits

Author SHA1 Message Date
dependabot[bot]
ab80e0337d
Bump mdeweerd/logToCheckStyle from 2024.3.5 to 2025.1.1
Bumps [mdeweerd/logToCheckStyle](https://github.com/mdeweerd/logtocheckstyle) from 2024.3.5 to 2025.1.1.
- [Commits](https://github.com/mdeweerd/logtocheckstyle/compare/v2024.3.5...v2025.1.1)

---
updated-dependencies:
- dependency-name: mdeweerd/logToCheckStyle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-03 05:55:39 +00:00
MDW
fffa47723f
Qual: Fix ci (pre-commit) Exclude/fix shellcheck notices 2025-01-15 14:37:24 +01:00
Laurent Destailleur (aka Eldy)
cf62921762 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-01-15 13:01:03 +01:00
Laurent Destailleur (aka Eldy)
c58016c2cf Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2025-01-15 12:46:26 +01:00
MDW
20f2293c01
Always install expected php version 2025-01-14 16:15:04 +01:00
MDW
7869e45954
Move installation of php before pre-commit run 2025-01-14 16:15:03 +01:00
MDW
9af7eaf08c
Use PHP version from check.php 2025-01-14 16:15:01 +01:00
Laurent Destailleur
47be1b9e3d Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-11-13 12:59:45 +01:00
Laurent Destailleur
e04ca76103 Doc github actions 2024-11-13 12:49:30 +01:00
Laurent Destailleur
a0ef0f2de5 Try to run windows-ci only if travis ok first. 2024-11-13 12:37:28 +01:00
MDW
622c718429
Qual: Add actions-lint to pre-commit (#31252)
# Qual: Add actions-lint to pre-commit

This finds issues with actions.
Fixed exakat.
2024-10-03 19:34:26 +02:00
dependabot[bot]
1fef18bc71
Bump tj-actions/changed-files from 44 to 45 (#30761)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44 to 45.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v44...v45)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 03:33:29 +02:00
MDW
fad3e2d2bf
QUAL: Add sqlfluff (SQL code and style check) (#29097)
* QUAL: Add sqlfluff (SQL code and style check)

# QUAL: Add sqlfluff (SQL code and style check)

This adds a validity and style check on the .sql files.
The same tool can be used to fix style (which can be set up as a
pre-commit hook).

* Ignore some sqlfluff notices

* Ignore RF04 notice, warning about the use of sql keywords

* Adjust dialects for some directories
2024-04-16 01:23:27 +02:00
Laurent Destailleur
8a942a632d
Merge pull request #29165 from Dolibarr/dependabot/github_actions/mdeweerd/logToCheckStyle-2024.3.5
Bump mdeweerd/logToCheckStyle from 2024.3.4 to 2024.3.5
2024-04-02 11:54:23 +02:00
dependabot[bot]
0580966d67
Bump mdeweerd/logToCheckStyle from 2024.3.4 to 2024.3.5
Bumps [mdeweerd/logToCheckStyle](https://github.com/mdeweerd/logtocheckstyle) from 2024.3.4 to 2024.3.5.
- [Commits](https://github.com/mdeweerd/logtocheckstyle/compare/v2024.3.4...v2024.3.5)

---
updated-dependencies:
- dependency-name: mdeweerd/logToCheckStyle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 05:52:18 +00:00
dependabot[bot]
352b895639
Bump tj-actions/changed-files from 43 to 44
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 43 to 44.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v43...v44)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 05:52:16 +00:00
MDW
ca36c740e5
"Qual: Add dependencies between workflows
# Qual: Add dependencies between workflows

Run costly workflows only after a few workflows succeed
(pre-commit, phan).
2024-03-22 09:50:42 +01:00
MDW
dc15b2ee79
Qual: Bump logToCheckStyle for better filename handling
# Qual: Bump logToCheckStyle for better filename handling

Some notifications from the PHPCS step in pre-commit extracted too many
characters for the filename in a specific case.
The update to logToCheckStyle fixes that.
2024-03-20 21:57:08 +01:00
Laurent Destailleur
4768243bf4
Merge pull request #28956 from Dolibarr/dependabot/github_actions/mdeweerd/logToCheckStyle-2024.3.2
Bump mdeweerd/logToCheckStyle from 2024.2.9 to 2024.3.2
2024-03-19 02:09:55 +01:00
Laurent Destailleur
db0dd76571
Merge pull request #28934 from Dolibarr/dependabot/github_actions/tj-actions/changed-files-43
Bump tj-actions/changed-files from 42 to 43
2024-03-19 01:54:46 +01:00
dependabot[bot]
35670de57c
Bump mdeweerd/logToCheckStyle from 2024.2.9 to 2024.3.2
Bumps [mdeweerd/logToCheckStyle](https://github.com/mdeweerd/logtocheckstyle) from 2024.2.9 to 2024.3.2.
- [Commits](https://github.com/mdeweerd/logtocheckstyle/compare/v2024.2.9...2024.3.2)

---
updated-dependencies:
- dependency-name: mdeweerd/logToCheckStyle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-19 00:45:11 +00:00
MDW
a08f330ca7 Qual: Always run phpcin pre-commit workflow
# Qual: Always run phpcs in pre-commit workflow

Developers are prioritizing the Travis Run because the pre-commit workflow
only runs the phpcs checks if the other pre-commit checks did not fail.
This modifies the action so that the phpcs checks are also run if the
previous step failed.

That should help limit travis load and delays.
2024-03-18 23:48:05 +01:00
dependabot[bot]
e72c596223
Bump tj-actions/changed-files from 42 to 43
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 42 to 43.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v42...v43)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 05:12:50 +00:00
MDW
f166f15f7d
Qual: Backport/pre commit / log annotation simplification (#28614)
* Qual: ci: Run pre-commit/php-cs with cache (#28079)

This adds a hook to .pre-commit-config.yaml and updates the workflow
to run php-cs with cache when it is run for all files.
When running on changed files only, the cache is not useful.

The php-codesniffer ruleset.xml was cleaned up (duplicates removal/formatted)

* Fix: Make all 'relative paths' absolute (#28196)

# Fix: Make all 'relative paths' absolute

The phpcs ruleset xml file's relative exclude patterns are relative to
the filename(s) provided on the command line.
Hence with partial verifications, the path exclusion does not function
as we would like.
Removing the relative-path attribute from the patterns the exclusion
works.
At the same time, the patterns were optimized and a comment was added.

* Qual: Optimize workflow (#28386)

# Qual: Optimize workflow

The log annotation based on the pre-commit logs is now simplified.
2024-03-04 18:21:32 +01:00
MDW
6115d58f47
Qual: Optimize workflow (#28386)
# Qual: Optimize workflow

The log annotation based on the pre-commit logs is now simplified.
2024-02-23 20:05:29 +01:00
MDW
60f15baef2
Qual: Backport: pre-commit php-cs with cache (#28123)
* Qual: Lower severity on php-cs messages that should not block (#28072)

# Qual: Lower severity on php-cs messages that should not block

Some warning messages result in php-cs having an exit code of 2 and others
only have an exit ocde of 1.  When the exit code is 2, the warnings are fixable
by php-cbf.

In order to be able to filter on the warnings in the github ci flow, but still
show them in the travis flow, I lower the level of the warnings that should not
be blocking to 4.

At the same time, the php-cs configuration in pre-commit now requires that the
severity is minimum 5 to show the message (level 5 is the default for all warnings
and errors).

So this will limit the warning messages to the ones that should result in a failing
ci action.  If any new cases are discovered, they should also be lowered in the
php-cs configuration file.

* Qual: ci: Run pre-commit/php-cs with cache (#28079)

This adds a hook to .pre-commit-config.yaml and updates the workflow
to run php-cs with cache when it is run for all files.
When running on changed files only, the cache is not useful.

The php-codesniffer ruleset.xml was cleaned up (duplicates removal/formatted)
2024-02-12 03:30:19 +01:00
MDW
7a389299c3
Qual: ci: Run pre-commit/php-cs with cache (#28079)
This adds a hook to .pre-commit-config.yaml and updates the workflow
to run php-cs with cache when it is run for all files.
When running on changed files only, the cache is not useful.

The php-codesniffer ruleset.xml was cleaned up (duplicates removal/formatted)
2024-02-10 01:22:07 +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
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
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