Skip to content

Commit 282273f

Browse files
committed
ci(common): simplify orchestration workflow
1 parent 52c08b7 commit 282273f

24 files changed

+996
-1139
lines changed

.github/actionlint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ self-hosted-runner:
1414
- m1mac
1515
- 4090-desktop
1616
- aws-mac1-metal
17+
18+
# Path-specific configurations
19+
paths:
20+
.github/workflows/**/*.{yml,yaml}:
21+
ignore:
22+
- SC2001 # https://www.shellcheck.net/wiki/SC2129
23+
24+
.github/workflows/common-pull-request-lint.yml:
25+
ignore:
26+
- property "result" is not defined in object type

.github/workflows/common-pull-request-lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
- name: actionlint
2525
uses: raven-actions/actionlint@3a24062651993d40fed1019b58ac6fbdfbf276cc # v2.0.1
2626
with:
27-
flags: "-ignore SC2001"
2827
version: ${{ env.ACTIONLINT_VERSION }}
2928

3029
- name: Ensure SHA pinned actions

.github/workflows/coprocessor-db-migration-docker-build.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: coprocessor-db-migration-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
6+
is-workflow-call:
7+
description: 'To determine if the trigger was a workflow_call or a pull request'
8+
type: boolean
89
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
13-
required: false
14-
default: 'manual'
15-
type: string
10+
default: true
11+
outputs:
12+
build-result:
13+
description: "Result of the build job of this workflow"
14+
value: ${{ jobs.build.result != null && jobs.build.result || 'not run' }}
1615
pull_request:
1716
push:
1817
branches:
@@ -35,6 +34,9 @@ jobs:
3534
contents: 'read' # Required to checkout repository code
3635
pull-requests: 'read' # Required to read pull request information
3736
runs-on: ubuntu-latest
37+
if: |
38+
inputs.is-workflow-call
39+
# TODO: re-enable this || (!inputs.is-workflow-call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3840
outputs:
3941
changes-coprocessor-db-migration: ${{ steps.filter.outputs.coprocessor-db-migration }}
4042
steps:
@@ -46,7 +48,7 @@ jobs:
4648
with:
4749
filters: |
4850
coprocessor-db-migration:
49-
- .github/workflows/coprocessor-db-migration-docker-build.yml
51+
# TODO: restore this - .github/workflows/coprocessor-db-migration-docker-build.yml
5052
- coprocessor/fhevm-engine/db-migration/**
5153
build:
5254
name: coprocessor-db-migration-docker-build/build (bpr)
@@ -74,27 +76,3 @@ jobs:
7476
image-name: "fhevm/coprocessor/db-migration"
7577
docker-file: "coprocessor/fhevm-engine/db-migration/Dockerfile"
7678
app-cache-dir: "fhevm-coprocessor-db-migration"
77-
output-build-status:
78-
name: coprocessor-db-migration-docker-build/output-build-status
79-
needs: [check-changes, build]
80-
if: always()
81-
permissions:
82-
contents: 'read'
83-
runs-on: ubuntu-latest
84-
outputs:
85-
image-built: ${{ steps.check-build.outputs.image-built }}
86-
image-tag: ${{ steps.check-build.outputs.image-tag }}
87-
steps:
88-
- name: Check if image was built
89-
id: check-build
90-
run: |
91-
# Check if docker build job ran and succeeded
92-
if [[ "${{ needs.build.result }}" == "success" ]]; then
93-
echo "image-built=true" >> "$GITHUB_OUTPUT"
94-
echo "image-tag=${{ github.sha }}" >> "$GITHUB_OUTPUT"
95-
echo "✅ Image was built successfully"
96-
else
97-
echo "image-built=false" >> "$GITHUB_OUTPUT"
98-
echo "image-tag=" >> "$GITHUB_OUTPUT"
99-
echo "⏭️ Image was not built (result: ${{ needs.build.result }})"
100-
fi

.github/workflows/coprocessor-gw-listener-docker-build.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: coprocessor-gw-listener-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
6+
is-workflow-call:
7+
description: 'To determine if the trigger was a workflow_call or a pull request'
8+
type: boolean
89
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
13-
required: false
14-
default: 'manual'
15-
type: string
10+
default: true
11+
outputs:
12+
build-result:
13+
description: "Result of the build job of this workflow"
14+
value: ${{ jobs.build.result != null && jobs.build.result || 'not run' }}
1615
pull_request:
1716
push:
1817
branches:
@@ -35,6 +34,9 @@ jobs:
3534
contents: 'read' # Required to checkout repository code
3635
pull-requests: 'read' # Required to read pull request information
3736
runs-on: ubuntu-latest
37+
if: |
38+
inputs.is-workflow-call
39+
# TODO: re-enable this || (!inputs.is-workflow-call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3840
outputs:
3941
changes-coprocessor-gw-listener: ${{ steps.filter.outputs.coprocessor-gw-listener }}
4042
steps:
@@ -46,7 +48,7 @@ jobs:
4648
with:
4749
filters: |
4850
coprocessor-gw-listener:
49-
- .github/workflows/coprocessor-docker-build-gw-listener.yml
51+
# TODO: restore this - .github/workflows/coprocessor-docker-build-gw-listener.yml
5052
- coprocessor/fhevm-engine/gw-listener/**
5153
- coprocessor/fhevm-engine/Cargo.toml
5254
- coprocessor/fhevm-engine/Cargo.lock
@@ -76,27 +78,3 @@ jobs:
7678
image-name: "fhevm/coprocessor/gw-listener"
7779
docker-file: "./coprocessor/fhevm-engine/gw-listener/Dockerfile"
7880
app-cache-dir: "fhevm-coprocessor-gw-listener"
79-
output-build-status:
80-
name: coprocessor-gw-listener-docker-build/output-build-status
81-
needs: [check-changes, build]
82-
if: always()
83-
permissions:
84-
contents: 'read'
85-
runs-on: ubuntu-latest
86-
outputs:
87-
image-built: ${{ steps.check-build.outputs.image-built }}
88-
image-tag: ${{ steps.check-build.outputs.image-tag }}
89-
steps:
90-
- name: Check if image was built
91-
id: check-build
92-
run: |
93-
# Check if docker build job ran and succeeded
94-
if [[ "${{ needs.build.result }}" == "success" ]]; then
95-
echo "image-built=true" >> "$GITHUB_OUTPUT"
96-
echo "image-tag=${{ github.sha }}" >> "$GITHUB_OUTPUT"
97-
echo "✅ Image was built successfully"
98-
else
99-
echo "image-built=false" >> "$GITHUB_OUTPUT"
100-
echo "image-tag=" >> "$GITHUB_OUTPUT"
101-
echo "⏭️ Image was not built (result: ${{ needs.build.result }})"
102-
fi

.github/workflows/coprocessor-host-listener-docker-build.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: coprocessor-host-listener-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
6+
is-workflow-call:
7+
description: 'To determine if the trigger was a workflow_call or a pull request'
8+
type: boolean
89
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
13-
required: false
14-
default: 'manual'
15-
type: string
10+
default: true
11+
outputs:
12+
build-result:
13+
description: "Result of the build job of this workflow"
14+
value: ${{ jobs.build.result != null && jobs.build.result || 'not run' }}
1615
pull_request:
1716
push:
1817
branches:
@@ -35,6 +34,9 @@ jobs:
3534
contents: 'read' # Required to checkout repository code
3635
pull-requests: 'read' # Required to read pull request information
3736
runs-on: ubuntu-latest
37+
if: |
38+
inputs.is-workflow-call
39+
# TODO: re-enable this || (!inputs.is-workflow-call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3840
outputs:
3941
changes-coprocessor-host-listener: ${{ steps.filter.outputs.coprocessor-host-listener }}
4042
steps:
@@ -46,7 +48,7 @@ jobs:
4648
with:
4749
filters: |
4850
coprocessor-host-listener:
49-
- .github/workflows/coprocessor-host-listener-docker-build.yml
51+
# TODO: restore this - .github/workflows/coprocessor-host-listener-docker-build.yml
5052
- coprocessor/fhevm-engine/host-listener/**
5153
- coprocessor/fhevm-engine/Cargo.toml
5254
- coprocessor/fhevm-engine/Cargo.lock
@@ -78,27 +80,3 @@ jobs:
7880
image-name: "fhevm/coprocessor/host-listener"
7981
docker-file: "coprocessor/fhevm-engine/host-listener/Dockerfile"
8082
app-cache-dir: "fhevm-coprocessor-host-listener"
81-
output-build-status:
82-
name: coprocessor-host-listener-docker-build/output-build-status
83-
needs: [check-changes, build]
84-
if: always()
85-
permissions:
86-
contents: 'read'
87-
runs-on: ubuntu-latest
88-
outputs:
89-
image-built: ${{ steps.check-build.outputs.image-built }}
90-
image-tag: ${{ steps.check-build.outputs.image-tag }}
91-
steps:
92-
- name: Check if image was built
93-
id: check-build
94-
run: |
95-
# Check if docker build job ran and succeeded
96-
if [[ "${{ needs.build.result }}" == "success" ]]; then
97-
echo "image-built=true" >> "$GITHUB_OUTPUT"
98-
echo "image-tag=${{ github.sha }}" >> "$GITHUB_OUTPUT"
99-
echo "✅ Image was built successfully"
100-
else
101-
echo "image-built=false" >> "$GITHUB_OUTPUT"
102-
echo "image-tag=" >> "$GITHUB_OUTPUT"
103-
echo "⏭️ Image was not built (result: ${{ needs.build.result }})"
104-
fi

.github/workflows/coprocessor-sns-worker-docker-build.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: coprocessor-sns-worker-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
6+
is-workflow-call:
7+
description: 'To determine if the trigger was a workflow_call or a pull request'
8+
type: boolean
89
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
13-
required: false
14-
default: 'manual'
15-
type: string
10+
default: true
11+
outputs:
12+
build-result:
13+
description: "Result of the build job of this workflow"
14+
value: ${{ jobs.build.result != null && jobs.build.result || 'not run' }}
1615
pull_request:
1716
push:
1817
branches:
@@ -35,6 +34,9 @@ jobs:
3534
contents: 'read' # Required to checkout repository code
3635
pull-requests: 'read' # Required to read pull request information
3736
runs-on: ubuntu-latest
37+
if: |
38+
inputs.is-workflow-call
39+
# TODO: re-enable this || (!inputs.is-workflow-call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3840
outputs:
3941
changes-coprocessor-sns-worker: ${{ steps.filter.outputs.coprocessor-sns-worker }}
4042
steps:
@@ -76,27 +78,3 @@ jobs:
7678
image-name: "fhevm/coprocessor/sns-worker"
7779
docker-file: "coprocessor/fhevm-engine/sns-worker/Dockerfile"
7880
app-cache-dir: "fhevm-coprocessor-sns-worker"
79-
output-build-status:
80-
name: coprocessor-sns-worker-docker-build/output-build-status
81-
needs: [check-changes, build]
82-
if: always()
83-
permissions:
84-
contents: 'read'
85-
runs-on: ubuntu-latest
86-
outputs:
87-
image-built: ${{ steps.check-build.outputs.image-built }}
88-
image-tag: ${{ steps.check-build.outputs.image-tag }}
89-
steps:
90-
- name: Check if image was built
91-
id: check-build
92-
run: |
93-
# Check if docker build job ran and succeeded
94-
if [[ "${{ needs.build.result }}" == "success" ]]; then
95-
echo "image-built=true" >> "$GITHUB_OUTPUT"
96-
echo "image-tag=${{ github.sha }}" >> "$GITHUB_OUTPUT"
97-
echo "✅ Image was built successfully"
98-
else
99-
echo "image-built=false" >> "$GITHUB_OUTPUT"
100-
echo "image-tag=" >> "$GITHUB_OUTPUT"
101-
echo "⏭️ Image was not built (result: ${{ needs.build.result }})"
102-
fi

.github/workflows/coprocessor-stress-test-tool-docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
filters: |
3636
coprocessor-stress-test-tool:
37-
- .github/workflows/coprocessor-docker-build-stress-test-tool.yml
37+
# TODO: restore this - .github/workflows/coprocessor-docker-build-stress-test-tool.yml
3838
- coprocessor/fhevm-engine/stress-test-generator/**
3939
- coprocessor/fhevm-engine/Cargo.toml
4040
- coprocessor/fhevm-engine/Cargo.lock

.github/workflows/coprocessor-tfhe-worker-docker-build.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: coprocessor-tfhe-worker-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
6+
is-workflow-call:
7+
description: 'To determine if the trigger was a workflow_call or a pull request'
8+
type: boolean
89
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
13-
required: false
14-
default: 'manual'
15-
type: string
10+
default: true
11+
outputs:
12+
build-result:
13+
description: "Result of the build job of this workflow"
14+
value: ${{ jobs.build.result != null && jobs.build.result || 'not run' }}
1615
pull_request:
1716
push:
1817
branches:
@@ -35,6 +34,9 @@ jobs:
3534
contents: 'read' # Required to checkout repository code
3635
pull-requests: 'read' # Required to read pull request information
3736
runs-on: ubuntu-latest
37+
if: |
38+
inputs.is-workflow-call
39+
# TODO: re-enable this || (!inputs.is-workflow-call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3840
outputs:
3941
changes-coprocessor-tfhe-worker: ${{ steps.filter.outputs.coprocessor-tfhe-worker }}
4042
steps:
@@ -46,7 +48,7 @@ jobs:
4648
with:
4749
filters: |
4850
coprocessor-tfhe-worker:
49-
- .github/workflows/coprocessor-tfhe-worker-docker-build.yml
51+
# TODO: restore this - .github/workflows/coprocessor-tfhe-worker-docker-build.yml
5052
- coprocessor/fhevm-engine/tfhe-worker/**
5153
- coprocessor/fhevm-engine/Cargo.toml
5254
- coprocessor/fhevm-engine/Cargo.lock
@@ -76,27 +78,3 @@ jobs:
7678
image-name: "fhevm/coprocessor/tfhe-worker"
7779
docker-file: "coprocessor/fhevm-engine/tfhe-worker/Dockerfile"
7880
app-cache-dir: "fhevm-coprocessor-tfhe-worker"
79-
output-build-status:
80-
name: coprocessor-tfhe-worker-docker-build/output-build-status
81-
needs: [check-changes, build]
82-
if: always()
83-
permissions:
84-
contents: 'read'
85-
runs-on: ubuntu-latest
86-
outputs:
87-
image-built: ${{ steps.check-build.outputs.image-built }}
88-
image-tag: ${{ steps.check-build.outputs.image-tag }}
89-
steps:
90-
- name: Check if image was built
91-
id: check-build
92-
run: |
93-
# Check if docker build job ran and succeeded
94-
if [[ "${{ needs.build.result }}" == "success" ]]; then
95-
echo "image-built=true" >> "$GITHUB_OUTPUT"
96-
echo "image-tag=${{ github.sha }}" >> "$GITHUB_OUTPUT"
97-
echo "✅ Image was built successfully"
98-
else
99-
echo "image-built=false" >> "$GITHUB_OUTPUT"
100-
echo "image-tag=" >> "$GITHUB_OUTPUT"
101-
echo "⏭️ Image was not built (result: ${{ needs.build.result }})"
102-
fi

0 commit comments

Comments
 (0)