Adding proper directory path normalization for artefacts
Publish PHP Package / docker (push) Successful in 9s Details

This commit is contained in:
Pavel Shevaev 2025-04-25 17:37:53 +03:00
parent e5f15251d7
commit 66b3abf819
1 changed files with 8 additions and 2 deletions

View File

@ -89,8 +89,10 @@ class TaskmanArtefact
{ {
if(!isset($this->sources_affected[$idx])) if(!isset($this->sources_affected[$idx]))
{ {
$file_changes = $this->task->getFileChanges(); $sources = $this->task->getFileChanges() != null ?
$sources = $file_changes != null ? $this->getChangedSources($idx) : $this->getSources($idx); //tries to match changed files with sources spec
$this->getChangedSources($idx) :
$this->getSources($idx);
$this->sources_affected[$idx] = is_stale($this->getPath(), $sources); $this->sources_affected[$idx] = is_stale($this->getPath(), $sources);
} }
@ -131,7 +133,10 @@ class TaskmanArtefact
$this->setSourcesFn($src_idx, function() use($src_spec) { $this->setSourcesFn($src_idx, function() use($src_spec) {
$dir2files = array(); $dir2files = array();
foreach($src_spec[0] as $spec_dir) foreach($src_spec[0] as $spec_dir)
{
$spec_dir = normalize_path($spec_dir);
$dir2files[$spec_dir] = scan_files([$spec_dir], $src_spec[1]); $dir2files[$spec_dir] = scan_files([$spec_dir], $src_spec[1]);
}
return new TaskmanDirFiles($dir2files); return new TaskmanDirFiles($dir2files);
}); });
@ -141,6 +146,7 @@ class TaskmanArtefact
$changed = array(); $changed = array();
foreach($src_spec[0] as $spec_dir) foreach($src_spec[0] as $spec_dir)
{ {
$spec_dir = normalize_path($spec_dir);
$matches = $file_changes->matchDirectory($spec_dir, $src_spec[1]); $matches = $file_changes->matchDirectory($spec_dir, $src_spec[1]);
$changed[$spec_dir] = $matches; $changed[$spec_dir] = $matches;
} }