return codecov artifact from modal image

This commit is contained in:
Dan Saunders
2025-06-17 13:33:02 -04:00
parent 753e4e3dec
commit 639ddeff6a
3 changed files with 807 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
"""Modal app to run axolotl GPU tests"""
import pathlib
from .single_gpu import GPU_CONFIG, VOLUME_CONFIG, app, cicd_image, run_cmd
@@ -12,9 +14,21 @@ from .single_gpu import GPU_CONFIG, VOLUME_CONFIG, app, cicd_image, run_cmd
volumes=VOLUME_CONFIG,
)
def cicd_pytest():
run_cmd("./cicd/cicd.sh", "/workspace/axolotl")
# Read the coverage file if it exists
coverage_file = pathlib.Path("/workspace/axolotl/e2e-coverage.xml")
if coverage_file.exists():
return coverage_file.read_text(encoding="utf-8")
return None
@app.local_entrypoint()
def main():
cicd_pytest.remote()
coverage = cicd_pytest.remote()
# Save the coverage file to the local filesystem if it was generated
if coverage:
with open("e2e-coverage.xml", "w", encoding="utf-8") as f:
f.write(coverage)