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

Error refactor #168

Merged
merged 42 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2513aec
feat: Add new error variants
petarvujovic98 May 7, 2024
2071ae1
refactor: Use top level error and tracing instead of stdio
petarvujovic98 May 7, 2024
595c762
refactor: Use error propagation instead of panicking
petarvujovic98 May 7, 2024
09b762d
refactor: Use top level errors and propagate
petarvujovic98 May 7, 2024
8b37423
fix: Remove the Err wrap around HostError
petarvujovic98 May 7, 2024
b9a124a
refactor: Use top level errors and simplify preflight function
petarvujovic98 May 7, 2024
8cdfc5d
refactor: Adapt to error changes
petarvujovic98 May 7, 2024
43d966f
chore: Remove patch for new nightly toolchain
petarvujovic98 May 7, 2024
f16625b
chore: Add generated openapi spec file
petarvujovic98 May 7, 2024
1600959
misc: Fix comment typo
petarvujovic98 May 8, 2024
7db626e
chore: Use tracing macros instead of println
petarvujovic98 May 8, 2024
b4f9a8a
fix: Add prover specific args struct to open api definitions
petarvujovic98 May 8, 2024
7f8c1e5
chore: Run clippy fix
petarvujovic98 May 8, 2024
7d0dc4b
chore: Fix useless conversions
petarvujovic98 May 8, 2024
c65167a
feat: Add docs genereation workflow on github pages
petarvujovic98 May 8, 2024
238982f
refactor: Make doc creation a oneliner
petarvujovic98 May 8, 2024
7a6915d
feat: Add initial output documentation
petarvujovic98 May 8, 2024
7e7f3c1
feat: Add documentation comments
petarvujovic98 May 8, 2024
90aea0a
feat: Improve request documentation and add scalar to raiko instance …
petarvujovic98 May 8, 2024
5991973
chore: Add OpenAPI section
petarvujovic98 May 8, 2024
775050e
misc: Fix typos in readme text
petarvujovic98 May 8, 2024
de08e86
fix: Upload artifact during build steps in order not to lose it
petarvujovic98 May 9, 2024
ef83e67
fix: Expect error for creating RBDP
petarvujovic98 May 9, 2024
3cda1e8
chore: Use warn instead of debug scope
petarvujovic98 May 9, 2024
0f51821
chore: Remove unused dependency
petarvujovic98 May 9, 2024
96ad5d8
chore: Move index.html to openapi to reduce artifact for GitHub pages
petarvujovic98 May 9, 2024
04ffbc4
fix: Make openapi directory before docs generation
petarvujovic98 May 9, 2024
f04fc94
refactor: Use matrix for equivalent jobs
petarvujovic98 May 9, 2024
4341ac6
fix: Add actual matrix definition
petarvujovic98 May 9, 2024
52db5c7
refactor: Improve metrics accuracy for time observations
petarvujovic98 May 9, 2024
fcdf281
chore: Run clippy pedantic
petarvujovic98 May 9, 2024
2cb9300
misc: Use single line command macro attribute
petarvujovic98 May 9, 2024
36ab9a8
fix: Fix doc test
petarvujovic98 May 9, 2024
c236592
fix: Remove doc example
petarvujovic98 May 9, 2024
a79eada
feat: Update response doc
petarvujovic98 May 10, 2024
ef3dd88
feat: Change ouput struct
petarvujovic98 May 10, 2024
251023d
fix: Fix rebase diff
petarvujovic98 May 13, 2024
5501712
fix: Add tracer build step for native target
petarvujovic98 May 13, 2024
a544347
fix: Rename to main
petarvujovic98 May 13, 2024
0b576bc
fix: Fix typo in CI
petarvujovic98 May 13, 2024
15972a1
fix: Fix GuestOutput structure in all provers
petarvujovic98 May 13, 2024
e7af23c
fixed some typos and tiny changes to log output
Brechtpd May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 56 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,107 +15,51 @@ concurrency:

jobs:
build-test:
name: Build and test native
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
matrix:
VERSIONS: [
{name: native, toolchain: nightly-2024-04-17},
{name: sp1, toolchain: nightly-2024-04-17},
{name: risc0, toolchain: stable},
{name: sgx, toolchain: stable},
]
env:
TARGET: native
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install native
run: make install
- name: Build native prover
run: make build
- name: Test native prover
run: make test
- name: Build with tracer
run: cargo build --features tracer

build-test-risc0:
name: Build and test risc0
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: risc0
CI: 1
MOCK: 1
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]
- uses: risc0/risc0/.github/actions/[email protected]
- name: Install risc0
run: make install
- name: Build risc0 prover
run: make build
- name: Test risc0 prover
run: make test

build-test-sp1:
name: Build and test sp1
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: sp1
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install sp1
run: make install
- name: Build sp1 prover
run: make build
- name: Test sp1 prover
run: make test

build-test-sgx:
name: Build and test sgx
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: sgx
TARGET: ${{ matrix.VERSIONS.name }}
CI: 1
MOCK: 1

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

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.VERSIONS.toolchain }}
profile: minimal

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

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

- name: Install ${{ matrix.VERSIONS.name }}
run: make install
- name: Build sgx prover

- name: Build ${{ matrix.VERSIONS.name }} prover
run: make build
- name: Test sgx prover

- name: Test ${{ matrix.VERSIONS.name }} prover
run: make test

- name: Build with tracer
if: ${{ matrix.VERSIONS.name }} == native
run: cargo build -F tracer

build-test-sgx-hardware:
name: Build and test sgx in hardware
Expand All @@ -125,27 +69,34 @@ jobs:
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

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
Expand All @@ -158,32 +109,42 @@ jobs:
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/[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 -- -Dwarnings
- 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 -- -Dwarnings

fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: risc0/risc0/.github/actions/[email protected]
- run: make fmt
- uses: actions/checkout@v4

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

- run: make fmt
48 changes: 48 additions & 0 deletions .github/workflows/openapi-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: OpenAPI

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

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy-docs:
name: Generate OpenAPI docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal

- name: Run docs generation binary
run: ./script/generate-docs.sh

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './openapi'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Loading
Loading