Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(repo): re-org workflows and limit runs to relative changes #224

Merged
merged 13 commits into from
May 31, 2024
50 changes: 50 additions & 0 deletions .github/workflows/ci-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI - All

on:
push:
branches: ["main"]
paths:
- "host/**"
- "lib/**"
- "primitives/**"
- "script/**"
pull_request:
paths:
- "host/**"
- "lib/**"
- "primitives/**"
- "script/**"
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-test-native:
uses: ./.github/workflows/ci-native.yml

build-test-risc0:
uses: ./.github/workflows/ci-risc0.yml

build-test-sp1:
uses: ./.github/workflows/ci-sp1.yml

build-test-sgx-all:
uses: ./.github/workflows/ci-sgx-all.yml

test-lib:
name: Test raiko-lib
runs-on: [taiko-runner]
timeout-minutes: 60

steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
profile: minimal

- run: cargo test -p raiko-lib --features=std
56 changes: 56 additions & 0 deletions .github/workflows/ci-build-test-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI Build and Test - Reusable

on:
workflow_call:
inputs:
version_name:
type: string
required: true
version_toolchain:
type: string
required: true

env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build-test:
name: Build and test
runs-on: [taiko-runner]
timeout-minutes: 120

env:
TARGET: ${{ inputs.version_name}}
CI: 1
MOCK: 1

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.version_toolchain }}
profile: minimal

- name: Install cargo-binstall
uses: cargo-bins/[email protected]

- name: Setup sccache
if: ${{ inputs.version_name }} == risc0
uses: risc0/risc0/.github/actions/[email protected]

- name: Install ${{ inputs.version_name }}
run: make install

- name: Build ${{ inputs.version_name }} prover
run: make build

- name: Test ${{ inputs.version_name }} prover
run: make test

- name: Build with tracer
if: ${{ inputs.version_name }} == native
run: cargo build -F tracer
40 changes: 40 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI - Lint

on:
pull_request:
types: [opened, reopened, edited, synchronize]

env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
clippy:
name: clippy
runs-on: [taiko-runner]
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: risc0/risc0/.github/actions/[email protected]

- uses: risc0/risc0/.github/actions/[email protected]

- uses: risc0/clippy-action@main
with:
reporter: 'github-pr-check'
fail_on_error: true
clippy_flags: --workspace --all-targets --all-features -- -D warnings

fmt:
name: fmt
runs-on: [taiko-runner]
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- uses: risc0/risc0/.github/actions/[email protected]

- run: make fmt
12 changes: 12 additions & 0 deletions .github/workflows/ci-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: CI - Native

on: workflow_call


jobs:
build-test-native:
name: Build and test native
uses: ./.github/workflows/ci-build-test-reusable.yml
with:
version_name: "native"
kimo-ice marked this conversation as resolved.
Show resolved Hide resolved
version_toolchain: "nightly-2024-04-17"
33 changes: 33 additions & 0 deletions .github/workflows/ci-provers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI - All Provers

on:
workflow_call:
push:
branches: ["main"]
paths:
- "pipelines/**"
- "harness/**"
pull_request:
paths:
- "pipelines/**"
- "harness/**"
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-test-native:
uses: ./.github/workflows/ci-native.yml

build-test-risc0:
uses: ./.github/workflows/ci-risc0.yml

build-test-sp1:
uses: ./.github/workflows/ci-sp1.yml

build-test-sgx-all:
uses: ./.github/workflows/ci-sgx-all.yml
20 changes: 20 additions & 0 deletions .github/workflows/ci-risc0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI - RISC0

on:
workflow_call:
push:
branches: ["main"]
paths:
- "provers/risc0/**"
pull_request:
paths:
- "provers/risc0/**"


jobs:
build-test-risc0:
name: Build and test risc0
uses: ./.github/workflows/ci-build-test-reusable.yml
with:
version_name: "risc0"
version_toolchain: "stable"
27 changes: 27 additions & 0 deletions .github/workflows/ci-sgx-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI - SGX ALL

on:
workflow_call:
push:
branches: ["main"]
paths:
- "provers/sgx/**"
pull_request:
paths:
- "provers/sgx/**"

jobs:
build-test-sgx:
name: Build and test sgx
uses: ./.github/workflows/ci-build-test-reusable.yml
with:
version_name: "sgx"
version_toolchain: "stable"

build-test-sgx-docker:
name: Build and test sgx with Docker
uses: ./.github/workflows/ci-sgx-docker.yml

build-test-sgx-hardware:
name: Build and test sgx in hardware
kimo-ice marked this conversation as resolved.
Show resolved Hide resolved
uses: ./.github/workflows/ci-sgx-hardware.yml
25 changes: 25 additions & 0 deletions .github/workflows/ci-sgx-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI - SGX Docker

on:
workflow_call:
push:
branches: ["main"]
paths:
- "docker/**"
pull_request:
paths:
- "docker/**"

jobs:
build-test-sgx-with-docker:
name: Build and test sgx with Docker
runs-on: [taiko-runner]
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
- name: Setup and build
run: |
cd docker
docker compose build --no-cache
shell: bash
35 changes: 35 additions & 0 deletions .github/workflows/ci-sgx-hardware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI - SGX Hardware

on: workflow_call

jobs:
build-test-sgx-hardware:
name: Build and test sgx in hardware
runs-on: [self-hosted, sgx, linux]
timeout-minutes: 120
env:
TARGET: sgx
CI: 1
EDMM: 0

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Install cargo-binstall
uses: cargo-bins/[email protected]

- name: Install sgx
run: make install

- name: Build sgx prover
run: make build

- name: Test sgx prover
run: make test
19 changes: 19 additions & 0 deletions .github/workflows/ci-sp1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI - SP1

on:
workflow_call:
push:
branches: ["main"]
paths:
- "provers/sp1/**"
pull_request:
paths:
- "provers/sp1/**"

jobs:
build-test-sgx:
name: Build and test sp1
uses: ./.github/workflows/ci-build-test-reusable.yml
with:
version_name: "sp1"
version_toolchain: "nightly-2024-04-17"
taiko-kitty marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading