Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
chore: sort imports
Browse files Browse the repository at this point in the history
chore: Don't check in generated files

chore: remove OUTPUT_TYPE env var

chore: rename uploaded files
  • Loading branch information
DerekMaggio committed Nov 16, 2023
1 parent 058557e commit 37c746c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,7 @@ tests/test_data/**/*analysis.json
test-results.xml
report.html
result/

# Generated Report Files
protocols_and_analyses.md
protocols_and_analyses.zip
10 changes: 1 addition & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ inputs:
description: 'relative path in the repository of the root folder in which to search for to search for protocols'
required: false
default: 'protocols'
OUTPUT_TYPE:
type: choice
description: 'type of output the action generates'
required: false
default: 'none'
options:
- 'none'
- 'zip'
- 'markdown'
type: string
runs:
using: 'docker'
# image: 'docker://ghcr.io/y3rsh/ot-analyze:main'
Expand Down
9 changes: 5 additions & 4 deletions ot_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

from write_failed_analysis import write_failed_analysis

FILE_BASENAME = "protocols_and_analyses"
ZIP_FILE_BASENAME = "protocols_and_analyses"
MARKDOWN_FILE_BASENAME = "summary"

SUCCESS_COLOR = "#7beb73"
FAILURE_COLOR = "#eb7373"
Expand Down Expand Up @@ -210,7 +211,7 @@ def find_python_protocols(directory: Path) -> List[Path]:
def create_zip(directory_path: Path):
absolute_directory_path = directory_path.absolute()
try:
archive_name = shutil.make_archive(FILE_BASENAME, 'zip', absolute_directory_path, absolute_directory_path)
archive_name = shutil.make_archive(ZIP_FILE_BASENAME, 'zip', absolute_directory_path, absolute_directory_path)
print(f"Zipfile created and saved to: {absolute_directory_path / archive_name}")

except Exception as e:
Expand Down Expand Up @@ -242,9 +243,9 @@ def generate_result(protocol_path: ProtocolPaths) -> str:
markdown_content = MARKDOWN_TEMPLATE.format(
results="\n".join([generate_result(protocol_path) for protocol_path in protocol_paths]),
)
markdown_file_name = f"{FILE_BASENAME}.md"
markdown_file_name = f"{MARKDOWN_FILE_BASENAME}.md"
absolute_directory_path = Path.cwd()
with open(FILE_BASENAME + ".md", "w") as file:
with open(markdown_file_name, "w") as file:
file.write(markdown_content)
print(f"Markdown file created and saved to: {absolute_directory_path / markdown_file_name}")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_analyze.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from pathlib import Path

from ot_analyze import analyze, generate_analysis_path, ProtocolPaths
from ot_analyze import ProtocolPaths, analyze, generate_analysis_path

import test_data.data as td

Expand Down

0 comments on commit 37c746c

Please sign in to comment.