Skip to content

Commit

Permalink
ci(core): add back docker build workflow (#1295)
Browse files Browse the repository at this point in the history
Reverts #1286

It turns out adding `workflow_run` for Hive and Assertor was working
after all (it took some time, wtf github actions). Do I re-added it.

Merge queue only runs when the PR is not synced with main, so it does
not work as a guarantee. Instead I moved most checks to be run as part
of `push`, to at least be able to pin point if something breaks.
  • Loading branch information
mpaulucci authored Nov 27, 2024
1 parent b64c23c commit 304cafc
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 58 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/asertoor.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
name: Assertoor
on:
pull_request:
branches: ["**"]
paths-ignore:
- "README.md"
- "LICENSE"
- "**/README.md"
- "**/docs/**"
- "crates/vm/levm/**"
- "crates/l2/**"
workflow_run:
workflows: [Docker build]
types: [completed]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -18,13 +12,10 @@ env:
RUST_VERSION: 1.80.1

jobs:
build:
uses: ./.github/workflows/docker_build.yaml

run-assertoor:
name: Stability Check
runs-on: ubuntu-latest
needs: [build]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -33,6 +24,8 @@ jobs:
with:
name: ethrex_image
path: /tmp
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Load image
run: |
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: CI
on:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]
paths-ignore:
- "README.md"
- "LICENSE"
- "**/README.md"
- "**/docs/**"
- "crates/vm/levm/**" # We run this in a separate workflow
# paths-ignore:
# - "README.md"
# - "LICENSE"
# - "**/README.md"
# - "**/docs/**"
# - "crates/vm/levm/**" # We run this in a separate workflow

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci_l2.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: CI (L2)
on:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_levm.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI LEVM

on:
push:
branches: ["main"]
merge_group:
paths:
- "crates/vm/levm/**"
pull_request:
branches: ["**"]
paths:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
name: Docker build

# This workflow is later used in assertoor and hive workflows
on:
workflow_call:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]
# paths-ignore:
# - "README.md"
# - "LICENSE"
# - "**/README.md"
# - "**/docs/**"

jobs:
docker_build:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish docker image to Github Packages

on:
push:
branches: ['main']
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -44,13 +44,13 @@ jobs:
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

19 changes: 6 additions & 13 deletions .github/workflows/hive.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
name: Hive
on:
pull_request:
branches: ["**"]
paths-ignore:
- "README.md"
- "LICENSE"
- "**/README.md"
- "**/docs/**"
- "crates/vm/levm/**"
- "crates/l2/**"
workflow_run:
workflows: [Docker build]
types: [completed]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -18,13 +12,10 @@ env:
RUST_VERSION: 1.80.1

jobs:
build:
uses: ./.github/workflows/docker_build.yaml

run-hive:
name: ${{ matrix.name }}
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -55,6 +46,8 @@ jobs:
with:
name: ethrex_image
path: /tmp
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Load image
run: |
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/hive_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,14 @@ env:
RUST_VERSION: 1.80.1

jobs:
build:
uses: ./.github/workflows/docker_build.yaml

hive-coverage:
name: Run engine hive simulator to gather coverage information.
name: Daily Hive Coverage
runs-on: ubuntu-latest
needs: [build]
steps:
# TODO: Maybe this can be reused as well.
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ethrex_image
path: /tmp

- name: Load image
- name: Pull image
run: |
docker load --input /tmp/ethrex_image.tar
docker pull ghcr.io/lambdaclass/ethrex:latest
docker tag ghcr.io/lambdaclass/ethrex:latest ethrex:latest
- name: Checkout sources
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/l2_contracts.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: L2 Contracts CI
on:
push:
branches: ["main"]
merge_group:
paths:
- "crates/l2/contracts/**"
pull_request:
branches: ["**"]
paths:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/l2_prover_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: L2 Prover CI
on:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint_pr_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
types:
- opened
- edited
- synchronize

jobs:
main:
Expand Down

0 comments on commit 304cafc

Please sign in to comment.