update the test_gitea
All checks were successful
Test Gitea Secrets / print-secret (push) Successful in 50s

This commit is contained in:
DatTT127
2026-07-16 22:34:16 +07:00
parent 2e439d2787
commit 8a8f91d99d
2 changed files with 39 additions and 8 deletions

View File

@@ -5,11 +5,9 @@ jobs:
print-secret:
runs-on: ubuntu-latest
steps:
- name: Print Secret
env:
# Map the Gitea secret to an environment variable
MY_TEST_SECRET: ${{ secrets.MODAL_KEY }}
run: |
# Use 'echo' to print the variable
# Gitea will automatically mask the actual value if it matches a secret
echo "The secret value is: $MY_TEST_SECRET"
- name: test modal worker pipeline
uses: actions/checkout@v4
with:
sparse-checkout: |
cd workspace/sprint_1_2/CODEBASE/deps/implementation
modal deploy test_worker.py

View File

@@ -0,0 +1,33 @@
import modal
import subprocess
# 1. Define the App
app = modal.App("hello-world-build-worker")
# 2. Define a clean container image representing your worker environment
image = modal.Image.debian_slim().pip_install("requests")
# 3. Define the worker function
@app.function(
image=image,
# This keeps the worker container alive for 5 minutes after finishing,
# so subsequent runs start instantly (avoiding cold starts).
scaledown_window=300
)
def run_worker_job():
print("--- WORKER CONTAINER STARTED ---")
# Mimic fetching project files or setting up environment variables
test_env_var = "Lumina-Build-Sandbox"
print(f"Environment initialized. Target deployment: {test_env_var}")
# Run a simple shell command inside the container to mimic building/testing
print("Running build script simulation...")
result = subprocess.run(
["echo", "Hello World! Your Modal container is successfully building your Python app."],
capture_output=True,
text=True
)
print(f"Build output: {result.stdout.strip()}")
print("--- WORKER JOB COMPLETED SUCCESSFULLY ---")