Skip to content

Commit

Permalink
Propagate lkg flag to sub-workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
  • Loading branch information
kbattocchi committed Jun 28, 2023
1 parent 7a192df commit a35ba78
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: string
use_lkg:
description: 'Whether to use the last known good versions of dependencies'
required: true
required: false
default: True
type: boolean
# nightly
Expand All @@ -28,7 +28,7 @@ concurrency:
# Precompute the ref if the workflow was triggered by a workflow dispatch rather than copying this logic repeatedly
env:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }}
use_lkg: ${{ (github.event_name == 'workflow_dispatch' && inputs.use_lkg || github.event_name == 'pull_request') || null }}
use_lkg: ${{ (github.event_name == 'workflow_dispatch' && inputs.use_lkg) || github.event_name == 'pull_request' }}

jobs:
eval:
Expand Down Expand Up @@ -288,6 +288,7 @@ jobs:
repository: testpypi
# don't have access to env context here for some reason
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }}
use_lkg: ${{ (github.event_name == 'workflow_dispatch' && inputs.use_lkg) || github.event_name == 'pull_request' }}

docs:
name: Build documentation
Expand All @@ -299,7 +300,8 @@ jobs:
environment: test
# don't have access to env context here for some reason
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }}

use_lkg: ${{ (github.event_name == 'workflow_dispatch' && inputs.use_lkg) || github.event_name == 'pull_request' }}

verify:
name: Verify CI checks
needs: [lint, notebooks, tests, build, docs]
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
default: ''
type: string
use_lkg:
description: 'Whether to use the last known good versions of dependencies'
required: false
default: True
type: boolean
# annoyingly, there does not seem to be a way to share these input definitions between triggers
workflow_call:
inputs:
Expand All @@ -37,7 +42,11 @@ on:
required: false
default: ''
type: string

use_lkg:
description: 'Whether to use the last known good versions of dependencies'
required: false
default: True
type: boolean

jobs:
create_docs:
Expand All @@ -54,7 +63,7 @@ jobs:
python-version: 3.8 # because of our supported TensorFlow versions, must build on 3.6-3.8
- run: python -m pip install --upgrade pip && pip install --upgrade setuptools
name: Ensure latest pip and setuptools
- run: pip install -U cython && pip install -e .[all]
- run: pip install -U cython && pip install -e .[all] ${{ inputs.use_lkg && '-r lkg.txt' }}
name: Install econml[all]
- run: sudo apt-get -yq install graphviz
name: Install graphviz
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ on:
required: false
default: ''
type: string
use_lkg:
description: 'Whether to use the last known good versions of dependencies'
required: false
default: True
type: boolean

# annoyingly, there does not seem to be a way to share these input definitions between triggers
workflow_call:
inputs:
Expand All @@ -38,7 +44,11 @@ on:
required: false
default: ''
type: string

use_lkg:
description: 'Whether to use the last known good versions of dependencies'
required: false
default: True
type: boolean
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
Expand Down Expand Up @@ -81,7 +91,7 @@ jobs:
python-version: 3.8 # because of our supported TensorFlow versions, must build on 3.6-3.8
- run: python -m pip install --upgrade pip && pip install --upgrade setuptools
name: Ensure latest pip and setuptools
- run: pip install -U cython && pip install -e .[all]
- run: pip install -U cython && pip install -e .[all] ${{ inputs.use_lkg && '-r lkg.txt' }}
name: Install econml[all]
- run: python setup.py sdist
name: Build sdist
Expand Down

0 comments on commit a35ba78

Please sign in to comment.