Skip to content

Commit

Permalink
add source link commit override
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed May 16, 2023
1 parent 8ac58e7 commit 6dd3953
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ uploaded anywhere.
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- `UPLOAD_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>`. This is necessary because we want pull
request builds associated with their originating commit, even if the web-build happens on an ephemeral merge-commit.
- [reusable_build_web_demo.yml](reusable_build_web.yml) - This job builds the assets uploaded to `demo.rerun.io`.
- `SOURCE_LINK_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>` in the built app. This ensures that the
source source code link in the built app always points to the pull request's `HEAD`.
- [reusable_upload_web_demo.yml](reusable_upload_web_demo.yml) - This job uploads the `demo.rerun.io` assets to google cloud. By default this
only uploads to: `demo.rerun.io/commit/<commit>/`
- `MARK_PRERELEASE_FOR_MAINLINE` - If true, then the web assets will go to `demo.rerun.io/prelease/
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
WHEEL_ARTIFACT_NAME: linux-wheel-fast
SOURCE_LINK_COMMIT_OVERRIDE: ${{ github.event.pull_request.head.sha }}
secrets: inherit

upload-web-demo:
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/reusable_build_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
WHEEL_ARTIFACT_NAME:
required: true
type: string
# Each example in the built app contains a link to its source code.
# This determines the target commit to link to, and by default
# it is the current commit (github.sha)
SOURCE_LINK_COMMIT_OVERRIDE:
required: false
type: string

concurrency:
group: ${{ inputs.CONCURRENCY }}-build-web-demo
Expand Down Expand Up @@ -70,9 +76,18 @@ jobs:
which rerun
rerun --version
- name: Resolve source link commit hash
run: |
if [ -z "${{ inputs.SOURCE_LINK_COMMIT_OVERRIDE }}" ]; then
USED_SHA=${{ github.sha }}
else
USED_SHA=${{ inputs.SOURCE_LINK_COMMIT_OVERRIDE }}
fi
echo "SHORT_SHA=$(echo $USED_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Build web demo
env:
COMMIT_HASH: ${{ github.env.GITHUB_SHA }}
COMMIT_HASH: ${{ env.SHORT_SHA }}
run: |
python3 scripts/build_demo_app.py --skip-wasm-build
Expand Down

0 comments on commit 6dd3953

Please sign in to comment.