From 328ece3719e46c686c72e3188e02bd06c056e410 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 26 Feb 2024 17:37:20 -0800 Subject: [PATCH 1/3] fix: docker CI job doesn't trigger on master --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 75da2e1442dd7..6e624fac6525c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: build_preset: | - ${{ fromJson(github.event_name == 'pull_request' ? '["ci"]' : '["dev", "lean", "py310", "websocket", "dockerize"]') }} + ${{ fromJson(github.event_name === 'pull_request' ? '["ci"]' : '["dev", "lean", "py310", "websocket", "dockerize"]') }} fail-fast: false steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" From 7655d9c7bfa091baa557ad88483da1f198751d8f Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 26 Feb 2024 17:50:59 -0800 Subject: [PATCH 2/3] remove no-op --- .github/workflows/docker.yml | 2 +- .github/workflows/no-op.yml | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6e624fac6525c..c5cd6013d1f40 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: build_preset: | - ${{ fromJson(github.event_name === 'pull_request' ? '["ci"]' : '["dev", "lean", "py310", "websocket", "dockerize"]') }} + ${{ fromJson(github.event_name == 'pull_request' ? "[\"ci\"]" : "[\"dev\", \"lean\", \"py310\", \"websocket\", \"dockerize\"]") }} fail-fast: false steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" diff --git a/.github/workflows/no-op.yml b/.github/workflows/no-op.yml index afea397e00635..79b1d351365ca 100644 --- a/.github/workflows/no-op.yml +++ b/.github/workflows/no-op.yml @@ -52,20 +52,3 @@ jobs: run: | echo "This is a no-op step for python-lint to ensure a successful status." exit 0 - # section to be deleted after master merge - docker-build: - strategy: - matrix: - build_preset: ["dev", "lean", "py310", "websocket", "dockerize"] - platform: ["linux/amd64", "linux/arm64"] - exclude: - - build_preset: "dev" - platform: "linux/arm64" - - build_preset: "lean" - platform: "linux/arm64" - runs-on: ubuntu-latest - steps: - - name: No-op for docker - run: | - echo "No-op to get rid of the docker-build checks reqs in .asf.yml" - exit 0 From 59b92c9fbd232cbe198b460473dafc3e790e96e7 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 26 Feb 2024 18:08:11 -0800 Subject: [PATCH 3/3] debugging fromJSON --- .github/workflows/docker.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c5cd6013d1f40..819a2a8b048fb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,13 +13,24 @@ concurrency: cancel-in-progress: true jobs: + setup_matrix: + runs-on: ubuntu-latest + outputs: + matrix_config: ${{ steps.set_matrix.outputs.matrix_config }} + steps: + - id: set_matrix + run: | + MATRIX_CONFIG=$(if [ "${{ github.event_name }}" == "pull_request" ]; then echo '["ci"]'; else echo '["dev", "lean", "py310", "websocket", "dockerize"]'; fi) + echo "matrix_config=${MATRIX_CONFIG}" >> $GITHUB_OUTPUT + echo $GITHUB_OUTPUT + docker-build: name: docker-build + needs: setup_matrix runs-on: ubuntu-latest strategy: matrix: - build_preset: | - ${{ fromJson(github.event_name == 'pull_request' ? "[\"ci\"]" : "[\"dev\", \"lean\", \"py310\", \"websocket\", \"dockerize\"]") }} + build_preset: ${{fromJson(needs.setup_matrix.outputs.matrix_config)}} fail-fast: false steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"