Skip to content

Commit

Permalink
chore(repo): re-org workflows and limit runs to relative changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim committed May 19, 2024
1 parent d90acd0 commit 3755e54
Show file tree
Hide file tree
Showing 9 changed files with 283 additions and 150 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI - All

on:
push:
branches: ["main"]
paths:
- "host/**"
- "lib/**"
- "primitives/**"
- "script/**"
pull_request:

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-ngx-all.yml

test-lib:
name: Test raiko-lib
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4

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

- run: cargo test -p raiko-lib --features=std

clippy:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: risc0/risc0/.github/actions/rustup@release-0.19

- uses: risc0/risc0/.github/actions/sccache@release-0.19

- 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: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- uses: risc0/risc0/.github/actions/rustup@release-0.19

- run: make fmt
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: ubuntu-latest
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/cargo-binstall@v1.6.4

- name: Setup sccache
if: ${{ inputs.version_name }} == risc0
uses: risc0/risc0/.github/actions/sccache@release-0.19

- 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
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-sgx:
name: Build and test sgx with Docker
uses: ./.github/workflows/build-test.yml
with:
version_name: "native"
toolchain: "nightly-2024-04-17"
17 changes: 17 additions & 0 deletions .github/workflows/ci-risc0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI - RISC0

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


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

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


jobs:
build-test-sgx:
name: Build and test sgx with Docker
uses: ./.github/workflows/build-test.yml
with:
version_name: "sgx"
toolchain: "stable"

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

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/cargo-binstall@v1.6.4

- name: Install sgx
run: make install

- name: Build sgx prover
run: make build

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

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


jobs:
build-test-sgx-with-docker:
name: Build and test sgx with Docker
runs-on: ubuntu-latest
timeout-minutes: 60

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

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


jobs:
build-test-sgx:
name: Build and test sgx with Docker
uses: ./.github/workflows/build-test.yml
with:
version_name: "sp1"
toolchain: "nightly-2024-04-17"
30 changes: 30 additions & 0 deletions .github/workflows/ci-zkVMs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI - All zkVMs

on:
push:
branches: ["main"]
paths:
- "pipelines/**"
- "harness/**"
pull_request:

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-ngx-all.yml
Loading

0 comments on commit 3755e54

Please sign in to comment.