Skip to content

Commit

Permalink
reusable workflow limit
Browse files Browse the repository at this point in the history
  • Loading branch information
olupton committed Jun 26, 2024
1 parent 094e3d1 commit ed7a32c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ jobs:
echo "Error: If BUMP_MANIFEST=false, MERGE_BUMPED_MANIFEST cannot be true" >&2
exit 1
fi
nsys-jax:
needs: metadata
uses: ./.github/workflows/_nsys_jax.yaml
with:
PUBLISH_RENDERED_NOTEBOOK: ${{ needs.metadata.outputs.PUBLISH == 'true' }}
# TODO: these could/should be saved in the repository settings instead
RENDERED_NOTEBOOK_GIST_ID: e2cd3520201caab6b67385ed36fad3c1
MOCK_RENDERED_NOTEBOOK_GIST_ID: 16698d9e9e52320243165d61b5bb3975
secrets: inherit
bump-manifest:
needs: metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: ~nsys-jax pure-Python CI
name: nsys-jax pure-Python CI

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

on:
workflow_call:
inputs:
RENDERED_NOTEBOOK_GIST_ID:
type: string
description: GitHub Gist ID under nvjax user where outputs will be copied if PUBLISH_RENDERED_NOTEBOOK is true
required: true
PUBLISH_RENDERED_NOTEBOOK:
type: boolean
description: Whether to copy newly rendered notebooks to RENDERED_NOTEBOOK_GIST_ID
default: false
required: true
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
paths-ignore:
- '**.md'
push:
branches:
- main

env:
NSYS_JAX_PYTHON_FILES: JAX-Toolbox/.github/container/nsys-jax JAX-Toolbox/.github/container/jax_nsys
Expand Down Expand Up @@ -72,6 +76,9 @@ jobs:
notebook:
env:
# TODO: these could/should be saved in the repository settings instead
RENDERED_NOTEBOOK_GIST_ID: e2cd3520201caab6b67385ed36fad3c1
MOCK_RENDERED_NOTEBOOK_GIST_ID: 16698d9e9e52320243165d61b5bb3975
# Name/bash regex for shields.io endpoint JSON files
PUBLISH_NOTEBOOK_FILES: '(.*\.ipynb)'
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -145,9 +152,8 @@ jobs:
github-token: ${{ secrets.NVJAX_GIST_TOKEN }}
script: |
const srcId = "${{ steps.upload.outputs.result }}";
const dstId = "${{ inputs.PUBLISH_RENDERED_NOTEBOOK && vars.RENDERED_NOTEBOOK_GIST_ID || vars.MOCK_RENDERED_NOTEBOOK_GIST_ID }}";
const dstId = "${{ github.ref == 'refs/heads/main' && env.RENDERED_NOTEBOOK_GIST_ID || env.MOCK_RENDERED_NOTEBOOK_GIST_ID }}";
const { PUBLISH_NOTEBOOK_FILES } = process.env;
const
// Fetch existing files from destination gist
const { data: dstData } = await github.rest.gists.get({
Expand Down

0 comments on commit ed7a32c

Please sign in to comment.