Skip to content

Commit

Permalink
fix: better uploads (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkstrp authored Sep 10, 2024
1 parent 96810ce commit 9efc7c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
23 changes: 7 additions & 16 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions scripts/draft_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -257,8 +259,8 @@ def changed_variables_plots(self) -> str:
url_b = self.plots_base_url + "feature/" + plot
rows.append(
[
f'<img src="{url_a}" alt="Error in loading image.">',
f'<img src="{url_b}" alt="Error in loading image.">',
f'<img src="{url_a}" alt="Image not available">',
f'<img src="{url_b}" alt="Image not available">',
]
)

Expand Down

0 comments on commit 9efc7c1

Please sign in to comment.