From c72532a06b66e4295b3f10bc2ab53559d7d7796a Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Mon, 9 Dec 2024 15:18:09 -0600 Subject: [PATCH] Workflow fixups --- .../workflows/build-and-remove-template.yml | 23 ++++++++++--------- .github/workflows/build-containers.yml | 10 +------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-and-remove-template.yml b/.github/workflows/build-and-remove-template.yml index 64fa7ea2..b017c393 100644 --- a/.github/workflows/build-and-remove-template.yml +++ b/.github/workflows/build-and-remove-template.yml @@ -2,11 +2,11 @@ name: Build And Remove Docker Image # A workflow template that handles building+removing SPRAS containers. # Required inputs are: -# - path: The path to a container's Dockerfile directory, relative to the repo root -# - container: The registry/container to be built, without a tag -# - tag: The tag to be built -# - always-build: A boolean indicating whether the action should condition whether it builds the container -# on any detected changes +# - path: The path to a container's Dockerfile directory, relative to the repo root. +# - container: The registry/container to be built, without a tag. +# - tag: The tag to be built. +# - always_build: A boolean indicating whether the action should condition the container build +# on detected changes. # - context: The optional build context path, relative to the repo root. on: workflow_call: @@ -20,9 +20,10 @@ on: tag: required: true type: string - always-build: - required: true + always_build: + required: false type: boolean + default: false context: required: false type: string @@ -38,7 +39,7 @@ jobs: # check whether anything at that path has been modified relative to master's head. # If so, we'll set `env.changed=true` to trigger the build in a later step - name: Check for changes - if: ${{ inputs.always-build }} == 'false' + if: ${{ inputs.always_build }} id: check_changes run: | if git fetch origin master && git diff --name-only origin/master | grep -q "$(basename ${{ inputs.path }})"; then @@ -49,10 +50,10 @@ jobs: echo "changed=false" >> $GITHUB_ENV fi - - name: Set changed to true for always-build - if: ${{ inputs.always-build }} == 'true' + - name: Toggle container build if 'always_build' + if: ${{ inputs.always_build }} run: | - echo "Input for job 'always-build' is true -- building regardless of detected changes." + echo "Input for job 'always_build' is true -- building regardless of detected changes." echo "changed=true" >> $GITHUB_ENV - name: Build Docker image diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index 23187959..e7d7932e 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -9,56 +9,48 @@ jobs: path: docker-wrappers/OmicsIntegrator1 container: reedcompbio/omics-integrator-1 tag: latest - always-build: false build-and-remove-omics2: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/OmicsIntegrator2 container: reedcompbio/omics-integrator-2 tag: latest - always-build: false build-and-remove-pathlinker: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/PathLinker container: reedcompbio/pathlinker tag: v2 - always-build: false build-and-remove-meo: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/MEO container: reedcompbio/meo tag: latest - always-build: false build-and-remove-mincostflow: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/MinCostFlow container: reedcompbio/mincostflow tag: latest - always-build: false build-and-remove-allpairs: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/AllPairs container: reedcompbio/allpairs tag: v2 - always-build: false build-and-remove-domino: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/DOMINO container: reedcompbio/domino tag: latest - always-build: false build-and-remove-cytoscape: uses: "./.github/workflows/build-and-remove-template.yml" with: path: docker-wrappers/Cytoscape container: reedcompbio/py4cytoscape tag: v3 - always-build: false build-and-remove-spras: uses: "./.github/workflows/build-and-remove-template.yml" with: @@ -68,5 +60,5 @@ jobs: # Since any change to the SPRAS codebase would constitute a change to # the container we produce in this step, build the container regardless # of detected changes. - always-build: true + always_build: true context: ./