Skip to content

Commit

Permalink
use latest commit hash in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed May 12, 2023
1 parent ed6c9ef commit 6619a92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/reusable_build_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
rerun --version
- name: Build web demo
env:
COMMIT_HASH: ${{ github.env.GITHUB_SHA }}
run: |
python3 scripts/build_demo_app.py --skip-wasm-build
Expand Down
14 changes: 12 additions & 2 deletions scripts/build_demo_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@


class Example:
def __init__(self, name: str, title: str, description: str, build_args: List[str]):
def __init__(
self,
name: str,
title: str,
description: str,
commit: str,
build_args: List[str],
):
self.path = os.path.join("examples/python", name, "main.py")
self.name = name
self.source_url = f"https://github.com/rerun-io/rerun/tree/main/examples/python/{self.name}/main.py"
self.source_url = f"https://github.com/rerun-io/rerun/tree/{commit}/examples/python/{self.name}/main.py"
self.title = title
self.build_args = build_args

Expand Down Expand Up @@ -84,12 +91,15 @@ def copy_wasm(examples: List[Example]) -> None:


def collect_examples() -> List[Example]:
commit = os.environ.get("COMMIT_HASH") or "main"
logging.info(f"Commit hash: {commit}")
examples = []
for name in EXAMPLES.keys():
example = Example(
name,
title=EXAMPLES[name]["title"],
description=EXAMPLES[name]["description"],
commit=commit,
build_args=EXAMPLES[name]["build_args"].split(" "),
)
if example.supports_save():
Expand Down

0 comments on commit 6619a92

Please sign in to comment.