ci: triggered by workflow_run to reuse the published images

This commit is contained in:
han0110
2026-02-11 08:10:06 +00:00
parent 39cd4e2548
commit 2f520cc947
11 changed files with 73 additions and 32 deletions

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: airbender

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: jolt

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: miden

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: nexus

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: openvm

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: pico

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: risc0

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: sp1

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: ziren

View File

@@ -5,13 +5,14 @@ concurrency:
cancel-in-progress: true
on:
push:
branches:
- master
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
jobs:
test:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/test-zkvm.yml
with:
zkvm: zisk

View File

@@ -40,6 +40,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- name: Check Dockerfile changes
id: changed_files
@@ -52,7 +54,11 @@ jobs:
- name: Get image metadata
id: image_meta
run: |
GIT_SHA="${{ github.sha }}"
if [ "${{ github.event_name }}" == "workflow_run" ]; then
GIT_SHA="${{ github.event.workflow_run.head_sha }}"
else
GIT_SHA="${{ github.sha }}"
fi
IMAGE_TAG="${GIT_SHA:0:7}"
CACHED_IMAGE_TAG=""
@@ -71,7 +77,7 @@ jobs:
build_image_cuda_check:
name: Build image with CUDA enabled
if: inputs.cuda
if: inputs.cuda && github.event_name == 'pull_request'
needs: image_meta
runs-on: ubuntu-latest
steps:
@@ -120,6 +126,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- name: Free up disk space
run: bash .github/scripts/free-up-disk-space.sh
@@ -129,7 +137,13 @@ jobs:
with:
key: rust-${{ inputs.zkvm }}-${{ hashFiles('Cargo.lock') }}
- name: Pull published base zkvm image
if: github.event_name == 'workflow_run'
run: |
docker pull ${{ needs.image_meta.outputs.base_zkvm_image }}
- name: Pull base zkvm image or build locally
if: github.event_name == 'pull_request'
run: |
bash .github/scripts/pull-or-build-base-zkvm-image.sh \
--zkvm ${{ inputs.zkvm }} \
@@ -169,6 +183,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- name: Free up disk space
run: bash .github/scripts/free-up-disk-space.sh
@@ -178,7 +194,13 @@ jobs:
with:
key: rust-${{ inputs.zkvm }}-${{ hashFiles('Cargo.lock') }}
- name: Pull published base zkvm image
if: github.event_name == 'workflow_run'
run: |
docker pull ${{ needs.image_meta.outputs.base_zkvm_image }}
- name: Pull base zkvm image or build locally
if: github.event_name == 'pull_request'
run: |
bash .github/scripts/pull-or-build-base-zkvm-image.sh \
--zkvm ${{ inputs.zkvm }} \
@@ -216,6 +238,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- name: Free up disk space
run: bash .github/scripts/free-up-disk-space.sh
@@ -230,7 +254,14 @@ jobs:
with:
key: rust-${{ inputs.zkvm }}-${{ hashFiles('Cargo.lock') }}
- name: Pull published images
if: github.event_name == 'workflow_run'
run: |
docker pull ${{ needs.image_meta.outputs.image_registry }}/ere-compiler-${{ inputs.zkvm }}:${{ needs.image_meta.outputs.image_tag }}
docker pull ${{ needs.image_meta.outputs.image_registry }}/ere-server-${{ inputs.zkvm }}:${{ needs.image_meta.outputs.image_tag }}
- name: Pull images or build locally
if: github.event_name == 'pull_request'
run: |
bash .github/scripts/pull-or-build-base-zkvm-image.sh \
--zkvm ${{ inputs.zkvm }} \