|
| 1 | +name: coprocessor-docker-build |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: |
| 6 | + - published |
| 7 | + workflow_call: |
| 8 | + secrets: |
| 9 | + AWS_ACCESS_KEY_S3_USER: |
| 10 | + required: true |
| 11 | + AWS_SECRET_KEY_S3_USER: |
| 12 | + required: true |
| 13 | + BLOCKCHAIN_ACTIONS_TOKEN: |
| 14 | + required: true |
| 15 | + CGR_USERNAME: |
| 16 | + required: true |
| 17 | + CGR_PASSWORD: |
| 18 | + required: true |
| 19 | + outputs: |
| 20 | + db_migration_build_result: |
| 21 | + description: "Result of the build-db-migration job" |
| 22 | + value: ${{ jobs.build-db-migration.result }} |
| 23 | + gw_listener_build_result: |
| 24 | + description: "Result of the build-gw-listener job" |
| 25 | + value: ${{ jobs.build-gw-listener.result }} |
| 26 | + host_listener_build_result: |
| 27 | + description: "Result of the build-host-listener job" |
| 28 | + value: ${{ jobs.build-host-listener.result }} |
| 29 | + sns_worker_build_result: |
| 30 | + description: "Result of the build-sns-worker job" |
| 31 | + value: ${{ jobs.build-sns-worker.result }} |
| 32 | + tfhe_worker_build_result: |
| 33 | + description: "Result of the build-tfhe-worker job" |
| 34 | + value: ${{ jobs.build-tfhe-worker.result }} |
| 35 | + tx_sender_build_result: |
| 36 | + description: "Result of the build-tx-sender job" |
| 37 | + value: ${{ jobs.build-tx-sender.result }} |
| 38 | + zkproof_worker_build_result: |
| 39 | + description: "Result of the build-zkproof-worker job" |
| 40 | + value: ${{ jobs.build-zkproof-worker.result }} |
| 41 | + workflow_dispatch: |
| 42 | + inputs: |
| 43 | + build_db_migration: |
| 44 | + description: "Enable/disable build for Coprocessor's DB Migration" |
| 45 | + type: boolean |
| 46 | + default: true |
| 47 | + build_gw_listener: |
| 48 | + description: "Enable/disable build for Coprocessor's Gateway Listener" |
| 49 | + type: boolean |
| 50 | + default: true |
| 51 | + build_host_listener: |
| 52 | + description: "Enable/disable build for Coprocessor's Host Listener" |
| 53 | + type: boolean |
| 54 | + default: true |
| 55 | + build_sns_worker: |
| 56 | + description: "Enable/disable build for Coprocessor's SNS Worker" |
| 57 | + type: boolean |
| 58 | + default: true |
| 59 | + build_tfhe_worker: |
| 60 | + description: "Enable/disable build for Coprocessor's TFHE Worker" |
| 61 | + type: boolean |
| 62 | + default: true |
| 63 | + build_tx_sender: |
| 64 | + description: "Enable/disable build for Coprocessor's Transaction Sender" |
| 65 | + type: boolean |
| 66 | + default: true |
| 67 | + build_zkproof_worker: |
| 68 | + description: "Enable/disable build for Coprocessor's ZKProof Worker" |
| 69 | + type: boolean |
| 70 | + default: true |
| 71 | + |
| 72 | +permissions: {} |
| 73 | + |
| 74 | +concurrency: |
| 75 | + group: coprocessor-docker-build-${{ github.ref_name }} |
| 76 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 77 | + |
| 78 | +jobs: |
| 79 | + check-changes: |
| 80 | + name: check-changes |
| 81 | + permissions: |
| 82 | + actions: 'read' # Required to read workflow run information |
| 83 | + contents: 'read' # Required to checkout repository code |
| 84 | + pull-requests: 'read' # Required to read pull request information |
| 85 | + runs-on: ubuntu-latest |
| 86 | + outputs: |
| 87 | + changes-db-migration: ${{ steps.filter.outputs.db-migration }} |
| 88 | + changes-gw-listener: ${{ steps.filter.outputs.gw-listener }} |
| 89 | + changes-host-listener: ${{ steps.filter.outputs.host-listener }} |
| 90 | + changes-sns-worker: ${{ steps.filter.outputs.sns-worker }} |
| 91 | + changes-tfhe-worker: ${{ steps.filter.outputs.tfhe-worker }} |
| 92 | + changes-tx-sender: ${{ steps.filter.outputs.tx-sender }} |
| 93 | + changes-zkproof-worker: ${{ steps.filter.outputs.zkproof-worker }} |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 96 | + with: |
| 97 | + persist-credentials: 'false' |
| 98 | + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 |
| 99 | + id: filter |
| 100 | + with: |
| 101 | + filters: | |
| 102 | + db-migration: |
| 103 | + - .github/workflows/coprocessor-docker-build.yml |
| 104 | + - coprocessor/fhevm-engine/db-migration/** |
| 105 | + gw-listener: |
| 106 | + - .github/workflows/coprocessor-docker-build.yml |
| 107 | + - coprocessor/fhevm-engine/gw-listener/** |
| 108 | + - coprocessor/fhevm-engine/Cargo.* |
| 109 | + host-listener: |
| 110 | + - .github/workflows/coprocessor-docker-build.yml |
| 111 | + - coprocessor/fhevm-engine/host-listener/** |
| 112 | + - coprocessor/fhevm-engine/Cargo.* |
| 113 | + - host-contracts/contracts/*Events.sol |
| 114 | + - host-contracts/contracts/shared/** |
| 115 | + sns-worker: |
| 116 | + - .github/workflows/coprocessor-docker-build.yml |
| 117 | + - coprocessor/fhevm-engine/sns-worker/** |
| 118 | + - coprocessor/fhevm-engine/Cargo.* |
| 119 | + tfhe-worker: |
| 120 | + - .github/workflows/coprocessor-docker-build.yml |
| 121 | + - coprocessor/fhevm-engine/tfhe-worker/** |
| 122 | + - coprocessor/fhevm-engine/Cargo.* |
| 123 | + tx-sender: |
| 124 | + - .github/workflows/coprocessor-docker-build.yml |
| 125 | + - coprocessor/fhevm-engine/transaction-sender/** |
| 126 | + - coprocessor/fhevm-engine/Cargo.* |
| 127 | + zkproof-worker: |
| 128 | + - .github/workflows/coprocessor-docker-build.yml |
| 129 | + - coprocessor/fhevm-engine/zkproof-worker/** |
| 130 | + - coprocessor/fhevm-engine/Cargo.* |
| 131 | +
|
| 132 | + build-db-migration: |
| 133 | + needs: check-changes |
| 134 | + if: | |
| 135 | + github.event_name == 'release' |
| 136 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-db-migration == 'true') |
| 137 | + || (github.event_name == 'workflow_dispatch' && inputs.build_db_migration) |
| 138 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 139 | + secrets: &docker_secrets |
| 140 | + AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }} |
| 141 | + AWS_SECRET_KEY_S3_USER: ${{ secrets.AWS_SECRET_KEY_S3_USER }} |
| 142 | + BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }} |
| 143 | + CGR_USERNAME: ${{ secrets.CGR_USERNAME }} |
| 144 | + CGR_PASSWORD: ${{ secrets.CGR_PASSWORD }} |
| 145 | + permissions: &docker_permissions |
| 146 | + actions: 'read' # Required to read workflow run information |
| 147 | + contents: 'read' # Required to checkout repository code |
| 148 | + pull-requests: 'read' # Required to read pull request information |
| 149 | + attestations: 'write' # Required to create build attestations |
| 150 | + packages: 'write' # Required to publish Docker images |
| 151 | + id-token: 'write' # Required for OIDC authentication |
| 152 | + with: |
| 153 | + use-cgr-secrets: true |
| 154 | + working-directory: "." |
| 155 | + image-name: "fhevm/coprocessor/db-migration" |
| 156 | + docker-file: "coprocessor/fhevm-engine/db-migration/Dockerfile" |
| 157 | + app-cache-dir: "fhevm-coprocessor-db-migration" |
| 158 | + |
| 159 | + build-gw-listener: |
| 160 | + needs: check-changes |
| 161 | + if: | |
| 162 | + github.event_name == 'release' |
| 163 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-gw-listener == 'true') |
| 164 | + || (github.event_name == 'workflow_dispatch' && inputs.build_gw_listener) |
| 165 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 166 | + permissions: *docker_permissions |
| 167 | + secrets: *docker_secrets |
| 168 | + with: |
| 169 | + use-cgr-secrets: true |
| 170 | + working-directory: "." |
| 171 | + image-name: "fhevm/coprocessor/gw-listener" |
| 172 | + docker-file: "./coprocessor/fhevm-engine/gw-listener/Dockerfile" |
| 173 | + app-cache-dir: "fhevm-coprocessor-gw-listener" |
| 174 | + |
| 175 | + build-host-listener: |
| 176 | + needs: check-changes |
| 177 | + if: | |
| 178 | + github.event_name == 'release' |
| 179 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-host-listener == 'true') |
| 180 | + || (github.event_name == 'workflow_dispatch' && inputs.build_host_listener) |
| 181 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 182 | + permissions: *docker_permissions |
| 183 | + secrets: *docker_secrets |
| 184 | + with: |
| 185 | + use-cgr-secrets: true |
| 186 | + working-directory: "." |
| 187 | + image-name: "fhevm/coprocessor/host-listener" |
| 188 | + docker-file: "coprocessor/fhevm-engine/host-listener/Dockerfile" |
| 189 | + app-cache-dir: "fhevm-coprocessor-host-listener" |
| 190 | + |
| 191 | + build-sns-worker: |
| 192 | + needs: check-changes |
| 193 | + if: | |
| 194 | + github.event_name == 'release' |
| 195 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-sns-worker == 'true') |
| 196 | + || (github.event_name == 'workflow_dispatch' && inputs.build_sns_worker) |
| 197 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 198 | + permissions: *docker_permissions |
| 199 | + secrets: *docker_secrets |
| 200 | + with: |
| 201 | + use-cgr-secrets: true |
| 202 | + working-directory: "." |
| 203 | + image-name: "fhevm/coprocessor/sns-worker" |
| 204 | + docker-file: "coprocessor/fhevm-engine/sns-worker/Dockerfile" |
| 205 | + app-cache-dir: "fhevm-coprocessor-sns-worker" |
| 206 | + |
| 207 | + build-tfhe-worker: |
| 208 | + needs: check-changes |
| 209 | + if: | |
| 210 | + github.event_name == 'release' |
| 211 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-tfhe-worker == 'true') |
| 212 | + || (github.event_name == 'workflow_dispatch' && inputs.build_tfhe_worker) |
| 213 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 214 | + permissions: *docker_permissions |
| 215 | + secrets: *docker_secrets |
| 216 | + with: |
| 217 | + use-cgr-secrets: true |
| 218 | + working-directory: "." |
| 219 | + image-name: "fhevm/coprocessor/tfhe-worker" |
| 220 | + docker-file: "coprocessor/fhevm-engine/tfhe-worker/Dockerfile" |
| 221 | + app-cache-dir: "fhevm-coprocessor-tfhe-worker" |
| 222 | + |
| 223 | + build-tx-sender: |
| 224 | + needs: check-changes |
| 225 | + if: | |
| 226 | + github.event_name == 'release' |
| 227 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-tx-sender == 'true') |
| 228 | + || (github.event_name == 'workflow_dispatch' && inputs.build_tx_sender) |
| 229 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 230 | + permissions: *docker_permissions |
| 231 | + secrets: *docker_secrets |
| 232 | + with: |
| 233 | + use-cgr-secrets: true |
| 234 | + working-directory: "." |
| 235 | + image-name: "fhevm/coprocessor/tx-sender" |
| 236 | + docker-file: "./coprocessor/fhevm-engine/transaction-sender/Dockerfile" |
| 237 | + app-cache-dir: "fhevm-coprocessor-tx-sender" |
| 238 | + |
| 239 | + build-zkproof-worker: |
| 240 | + needs: check-changes |
| 241 | + if: | |
| 242 | + github.event_name == 'release' |
| 243 | + || (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-zkproof-worker == 'true') |
| 244 | + || (github.event_name == 'workflow_dispatch' && inputs.build_zkproof_worker) |
| 245 | + uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1 |
| 246 | + permissions: *docker_permissions |
| 247 | + secrets: *docker_secrets |
| 248 | + with: |
| 249 | + use-cgr-secrets: true |
| 250 | + working-directory: "." |
| 251 | + image-name: "fhevm/coprocessor/zkproof-worker" |
| 252 | + docker-file: "coprocessor/fhevm-engine/zkproof-worker/Dockerfile" |
| 253 | + app-cache-dir: "fhevm-coprocessor-zkproof-worker" |
0 commit comments