Skip to content

Commit c5949fd

Browse files
committed
ci(common): simplify orchestration workflow
1 parent 296b5e5 commit c5949fd

24 files changed

+1194
-1142
lines changed

.github/actionlint.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ 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+
- 'property "result" is not defined in object type.*'
24+
- '".*" section is alias node but mapping node is expected'
25+
- 'secret ".*" is required by ".*" reusable workflow.*'

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

Lines changed: 1 addition & 2 deletions
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
@@ -48,4 +47,4 @@ jobs:
4847
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
4948
with:
5049
persona: pedantic
51-
version: 1.14.2
50+
version: 1.17.0

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

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

33
on:
4-
workflow_dispatch:
4+
workflow_call:
5+
secrets:
6+
AWS_ACCESS_KEY_S3_USER:
7+
required: true
8+
AWS_SECRET_KEY_S3_USER:
9+
required: true
10+
BLOCKCHAIN_ACTIONS_TOKEN:
11+
required: true
12+
CGR_USERNAME:
13+
required: true
14+
CGR_PASSWORD:
15+
required: true
516
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
8-
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
17+
is_workflow_call:
18+
description: 'To determine if the trigger was a workflow_call or a pull request'
19+
type: boolean
1320
required: false
14-
default: 'manual'
15-
type: string
21+
default: true
22+
outputs:
23+
build_result:
24+
description: "Result of the build job of this workflow"
25+
value: ${{ jobs.build.result }}
1626
pull_request:
1727
push:
1828
branches:
@@ -35,6 +45,9 @@ jobs:
3545
contents: 'read' # Required to checkout repository code
3646
pull-requests: 'read' # Required to read pull request information
3747
runs-on: ubuntu-latest
48+
if: |
49+
inputs.is_workflow_call
50+
# TODO: re-enable this || (!inputs.is_workflow_call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3851
outputs:
3952
changes-coprocessor-db-migration: ${{ steps.filter.outputs.coprocessor-db-migration }}
4053
steps:
@@ -46,7 +59,7 @@ jobs:
4659
with:
4760
filters: |
4861
coprocessor-db-migration:
49-
- .github/workflows/coprocessor-db-migration-docker-build.yml
62+
# TODO: restore this - .github/workflows/coprocessor-db-migration-docker-build.yml
5063
- coprocessor/fhevm-engine/db-migration/**
5164
build:
5265
name: coprocessor-db-migration-docker-build/build (bpr)
@@ -74,27 +87,3 @@ jobs:
7487
image-name: "fhevm/coprocessor/db-migration"
7588
docker-file: "coprocessor/fhevm-engine/db-migration/Dockerfile"
7689
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: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
name: coprocessor-gw-listener-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
5+
secrets:
6+
AWS_ACCESS_KEY_S3_USER:
7+
required: true
8+
AWS_SECRET_KEY_S3_USER:
9+
required: true
10+
BLOCKCHAIN_ACTIONS_TOKEN:
11+
required: true
12+
CGR_USERNAME:
13+
required: true
14+
CGR_PASSWORD:
15+
required: true
516
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
8-
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
17+
is_workflow_call:
18+
description: 'To determine if the trigger was a workflow_call or a pull request'
19+
type: boolean
1320
required: false
14-
default: 'manual'
15-
type: string
21+
default: true
22+
outputs:
23+
build_result:
24+
description: "Result of the build job of this workflow"
25+
value: ${{ jobs.build.result }}
1626
pull_request:
1727
push:
1828
branches:
@@ -35,6 +45,9 @@ jobs:
3545
contents: 'read' # Required to checkout repository code
3646
pull-requests: 'read' # Required to read pull request information
3747
runs-on: ubuntu-latest
48+
if: |
49+
inputs.is_workflow_call
50+
# TODO: re-enable this || (!inputs.is_workflow_call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3851
outputs:
3952
changes-coprocessor-gw-listener: ${{ steps.filter.outputs.coprocessor-gw-listener }}
4053
steps:
@@ -46,7 +59,7 @@ jobs:
4659
with:
4760
filters: |
4861
coprocessor-gw-listener:
49-
- .github/workflows/coprocessor-docker-build-gw-listener.yml
62+
# TODO: restore this - .github/workflows/coprocessor-docker-build-gw-listener.yml
5063
- coprocessor/fhevm-engine/gw-listener/**
5164
- coprocessor/fhevm-engine/Cargo.toml
5265
- coprocessor/fhevm-engine/Cargo.lock
@@ -76,27 +89,3 @@ jobs:
7689
image-name: "fhevm/coprocessor/gw-listener"
7790
docker-file: "./coprocessor/fhevm-engine/gw-listener/Dockerfile"
7891
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: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
name: coprocessor-host-listener-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
5+
secrets:
6+
AWS_ACCESS_KEY_S3_USER:
7+
required: true
8+
AWS_SECRET_KEY_S3_USER:
9+
required: true
10+
BLOCKCHAIN_ACTIONS_TOKEN:
11+
required: true
12+
CGR_USERNAME:
13+
required: true
14+
CGR_PASSWORD:
15+
required: true
516
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
8-
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
17+
is_workflow_call:
18+
description: 'To determine if the trigger was a workflow_call or a pull request'
19+
type: boolean
1320
required: false
14-
default: 'manual'
15-
type: string
21+
default: true
22+
outputs:
23+
build_result:
24+
description: "Result of the build job of this workflow"
25+
value: ${{ jobs.build.result }}
1626
pull_request:
1727
push:
1828
branches:
@@ -35,6 +45,9 @@ jobs:
3545
contents: 'read' # Required to checkout repository code
3646
pull-requests: 'read' # Required to read pull request information
3747
runs-on: ubuntu-latest
48+
if: |
49+
inputs.is_workflow_call
50+
# TODO: re-enable this || (!inputs.is_workflow_call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3851
outputs:
3952
changes-coprocessor-host-listener: ${{ steps.filter.outputs.coprocessor-host-listener }}
4053
steps:
@@ -46,7 +59,7 @@ jobs:
4659
with:
4760
filters: |
4861
coprocessor-host-listener:
49-
- .github/workflows/coprocessor-host-listener-docker-build.yml
62+
# TODO: restore this - .github/workflows/coprocessor-host-listener-docker-build.yml
5063
- coprocessor/fhevm-engine/host-listener/**
5164
- coprocessor/fhevm-engine/Cargo.toml
5265
- coprocessor/fhevm-engine/Cargo.lock
@@ -78,27 +91,3 @@ jobs:
7891
image-name: "fhevm/coprocessor/host-listener"
7992
docker-file: "coprocessor/fhevm-engine/host-listener/Dockerfile"
8093
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: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
name: coprocessor-sns-worker-docker-build
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
5+
secrets:
6+
AWS_ACCESS_KEY_S3_USER:
7+
required: true
8+
AWS_SECRET_KEY_S3_USER:
9+
required: true
10+
BLOCKCHAIN_ACTIONS_TOKEN:
11+
required: true
12+
CGR_USERNAME:
13+
required: true
14+
CGR_PASSWORD:
15+
required: true
516
inputs:
6-
ref:
7-
description: 'Branch/ref to build'
8-
required: false
9-
default: 'main'
10-
type: string
11-
trigger_source:
12-
description: 'Source that triggered this workflow'
17+
is_workflow_call:
18+
description: 'To determine if the trigger was a workflow_call or a pull request'
19+
type: boolean
1320
required: false
14-
default: 'manual'
15-
type: string
21+
default: true
22+
outputs:
23+
build_result:
24+
description: "Result of the build job of this workflow"
25+
value: ${{ jobs.build.result }}
1626
pull_request:
1727
push:
1828
branches:
@@ -35,6 +45,9 @@ jobs:
3545
contents: 'read' # Required to checkout repository code
3646
pull-requests: 'read' # Required to read pull request information
3747
runs-on: ubuntu-latest
48+
if: |
49+
inputs.is_workflow_call
50+
# TODO: re-enable this || (!inputs.is_workflow_call && !startsWith(github.head_ref, 'mergify/merge-queue/'))
3851
outputs:
3952
changes-coprocessor-sns-worker: ${{ steps.filter.outputs.coprocessor-sns-worker }}
4053
steps:
@@ -76,27 +89,3 @@ jobs:
7689
image-name: "fhevm/coprocessor/sns-worker"
7790
docker-file: "coprocessor/fhevm-engine/sns-worker/Dockerfile"
7891
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

0 commit comments

Comments
 (0)