Skip to content

Commit

Permalink
Fix context variable type error in jax nightly workflow (#285)
Browse files Browse the repository at this point in the history
Fixed a type error between string/Boolean values in the 'publish' job.
  • Loading branch information
yhtang authored Oct 5, 2023
1 parent f300efa commit 27b9069
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/nightly-jax-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
runs-on: ubuntu-22.04
outputs:
BUILD_DATE: ${{ steps.date.outputs.BUILD_DATE }}
PUBLISH: ${{ steps.if-publish.outputs.PUBLISH }}
steps:
- name: Set build date
id: date
Expand All @@ -30,6 +31,12 @@ jobs:
BUILD_DATE=$(TZ='US/Los_Angeles' date '+%Y-%m-%d')
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_OUTPUT
- name: Determine whether results will be 'published'
id: if-publish
shell: bash -x -e {0}
run: |
echo "PUBLISH=${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.PUBLISH) }}" >> $GITHUB_OUTPUT
build:
needs: metadata
uses: ./.github/workflows/_build_jax.yaml
Expand All @@ -51,8 +58,8 @@ jobs:
finalize:
if: always()
needs: [build]
needs: [metadata, build]
uses: ./.github/workflows/_finalize.yaml
with:
PUBLISH_BADGE: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.PUBLISH) }}
PUBLISH_BADGE: ${{ needs.metadata.outputs.PUBLISH == 'true' }}
secrets: inherit
17 changes: 11 additions & 6 deletions .github/workflows/nightly-jax-test-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
metadata:
runs-on: ubuntu-22.04
outputs:
JAX_IMAGE: ${{ steps.meta.outputs.JAX_IMAGE }}
PUBLISH: ${{ steps.meta.outputs.PUBLISH }}
JAX_IMAGE: ${{ steps.image.outputs.JAX_IMAGE }}
PUBLISH: ${{ steps.if-publish.outputs.PUBLISH }}
steps:
- name: Set metadata
id: meta
- name: Determine jax image to use
id: image
shell: bash -x -e {0}
run: |
if [[ -z "${{ inputs.JAX_IMAGE }}" ]]; then
Expand All @@ -50,6 +50,11 @@ jobs:
JAX_IMAGE=${{ inputs.JAX_IMAGE }}
fi
echo "JAX_IMAGE=${JAX_IMAGE}" >> $GITHUB_OUTPUT
- name: Determine whether results will be 'published'
id: if-publish
shell: bash -x -e {0}
run: |
echo "PUBLISH=${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && inputs.PUBLISH) }}" >> $GITHUB_OUTPUT
run:
Expand All @@ -62,8 +67,8 @@ jobs:

finalize:
if: always()
needs: [run]
needs: [metadata, run]
uses: ./.github/workflows/_finalize.yaml
with:
PUBLISH_BADGE: ${{ needs.metadata.outputs.PUBLISH }}
PUBLISH_BADGE: ${{ needs.metadata.outputs.PUBLISH == 'true' }}
secrets: inherit

0 comments on commit 27b9069

Please sign in to comment.