From 9efc7c1804a8016849ba4eaf9bad208577373447 Mon Sep 17 00:00:00 2001 From: Lukas Trippe Date: Tue, 10 Sep 2024 11:38:12 +0200 Subject: [PATCH] fix: better uploads (#18) --- action.yml | 23 +++++++---------------- scripts/draft_comment.py | 14 ++++++++------ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/action.yml b/action.yml index ba07c7d7..b88f4edc 100644 --- a/action.yml +++ b/action.yml @@ -138,33 +138,24 @@ runs: retention-days: 90 include-hidden-files: true - - name: Upload benchmarks + - name: Upload artifacts (benchmarks) if: ${{ inputs.step == 'run-self-hosted-validation' }} uses: actions/upload-artifact@v4 with: name: benchmarks path: | - ~/${{ github.repository }}/main/.snakemake/ - ~/${{ github.repository }}/feature/logs/ + ~/${{ github.repository }}/main/benchmarks/ + ~/${{ github.repository }}/feature/benchmarks/ retention-days: 90 include-hidden-files: true - - name: Upload artifacts (results main) + - name: Upload artifacts (results) if: ${{ inputs.step == 'run-self-hosted-validation' }} uses: actions/upload-artifact@v4 with: - name: results (main branch) + name: results path: | ~/${{ github.repository }}/main/results - retention-days: 90 - include-hidden-files: true - - - name: Upload artifacts (results feature) - if: ${{ inputs.step == 'run-self-hosted-validation' }} - uses: actions/upload-artifact@v4 - with: - name: results (feature branch) - path: | ~/${{ github.repository }}/feature/results retention-days: 90 include-hidden-files: true @@ -320,8 +311,8 @@ runs: mkdir -p "_validation-images/main/${subpath}" mkdir -p "_validation-images/feature/${subpath}" - cp "$HOME/artifacts/results (main branch)/${PREFIX_MAIN}/${subpath}/${plot}" "_validation-images/main/${subpath}/" || true # ignore if run failed - cp "$HOME/artifacts/results (feature branch)/${PREFIX_FEATURE}/${subpath}/${plot}" "_validation-images/feature/${subpath}/" || true # ignore if run failed + cp "$HOME/artifacts/results/main/results/${PREFIX_MAIN}/${subpath}/${plot}" "_validation-images/main/${subpath}/" || true # ignore if run failed + cp "$HOME/artifacts/results/feature/results/${PREFIX_FEATURE}/${subpath}/${plot}" "_validation-images/feature/${subpath}/" || true # ignore if run failed done # Add plots to repo branch diff --git a/scripts/draft_comment.py b/scripts/draft_comment.py index 2d937807..f32fdc36 100644 --- a/scripts/draft_comment.py +++ b/scripts/draft_comment.py @@ -145,21 +145,23 @@ def __init__(self): """Initialize class.""" self.dir_main = [ file - for file in (self.dir_artifacts / "results (main branch)").iterdir() + for file in (self.dir_artifacts / "results/main/results").iterdir() if file.is_dir() ] if len(self.dir_main) != 1: - msg = "Expected exactly one directory in 'results (main branch)'." + msg = "Expected exactly one directory (prefix) in 'results/main/results'." raise ValueError(msg) self.dir_main = self.dir_main[0] self.dir_feature = [ file - for file in (self.dir_artifacts / "results (feature branch)").iterdir() + for file in (self.dir_artifacts / "results/feature/results").iterdir() if file.is_dir() ] if len(self.dir_feature) != 1: - msg = "Expected exactly one directory in 'results (feature branch)'." + msg = ( + "Expected exactly one directory (prefix) in 'results/feature/results'." + ) raise ValueError(msg) self.dir_feature = self.dir_feature[0] @@ -257,8 +259,8 @@ def changed_variables_plots(self) -> str: url_b = self.plots_base_url + "feature/" + plot rows.append( [ - f'Error in loading image.', - f'Error in loading image.', + f'Image not available', + f'Image not available', ] )