Skip to content

Commit

Permalink
[CI] Enable to skip images in Build workflow (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedingber committed Jul 13, 2022
1 parent 0f20cd6 commit 65f4904
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-workflow-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"image-name":"mlrun"
},
{
"image-name":"api"
},
{
"image-name":"base"
},
{
"image-name":"models"
},
{
"image-name":"models-gpu"
},
{
"image-name":"jupyter"
},
{
"image-name":"test"
}
]
26 changes: 17 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,32 @@ on:
description: 'The version to build, without prefix v (e.g. 1.1.0), if not provided version will be <latest-release>-<commit-hash>'
required: false
default: ''
skip_images:
description: 'Comma separated list of images to skip building, example with all possible images: mlrun,api,base,models,models-gpu,jupyter,test'
required: false
default: ''
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: |
skipImages=,${{ github.event.inputs.skip_images }},
matrix=$(jq --arg skipImages "$skipImages" 'map(. | select(",\(."image-name")," | inside($skipImages)|not))' ./.github/workflows/build-workflow-matrix.json)
echo ::set-output name=matrix::{\"include\":$(echo $matrix)}
build-images:
name: Build and push image - ${{ matrix.image-name }}
runs-on: ubuntu-latest
needs: matrix_prep

# let's not run this on every fork, change to your fork when developing
if: github.repository == 'mlrun/mlrun' || github.event_name == 'workflow_dispatch'

strategy:
matrix:
image-name:
- mlrun
- api
- base
- models
- models-gpu
- jupyter
- test
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
steps:
- uses: actions/checkout@v2
- name: Install curl and jq
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
MLRUN_VERSION=${{ github.event.inputs.version }} make publish-package
create-releases:
name: Create release & tag
name: Create release & tag v${{ github.event.inputs.version }}
runs-on: ubuntu-latest
needs: publish-to-pypi
steps:
Expand Down

0 comments on commit 65f4904

Please sign in to comment.