Add CF DPP Blueprint comparison to Digital Product Passport doc #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ================================================================ | |
| # Stage 1: Build native libraries on each platform | |
| # ================================================================ | |
| build-gnark-native: | |
| name: gnark native (${{ matrix.os }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: linux-x86_64 | |
| runner: ubuntu-latest | |
| lib: libzeroj_gnark.so | |
| - os: linux-arm64 | |
| runner: ubuntu-24.04-arm | |
| lib: libzeroj_gnark.so | |
| - os: macos-arm64 | |
| runner: macos-14 | |
| lib: libzeroj_gnark.dylib | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Build gnark shared library | |
| working-directory: zeroj-prover-gnark/gnark-wrapper | |
| run: make build | |
| - name: Upload native library | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gnark-native-${{ matrix.os }} | |
| path: zeroj-prover-gnark/src/main/resources/native/${{ matrix.os }}/${{ matrix.lib }} | |
| retention-days: 1 | |
| build-halo2-native: | |
| name: halo2 native (${{ matrix.os }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: linux-x86_64 | |
| runner: ubuntu-latest | |
| lib: libzeroj_halo2.so | |
| - os: linux-arm64 | |
| runner: ubuntu-24.04-arm | |
| lib: libzeroj_halo2.so | |
| - os: macos-arm64 | |
| runner: macos-14 | |
| lib: libzeroj_halo2.dylib | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build halo2 shared library | |
| working-directory: zeroj-verifier-halo2/halo2-rust | |
| run: cargo build --release | |
| - name: Copy library to resource path | |
| run: | | |
| mkdir -p zeroj-verifier-halo2/src/main/resources/native/${{ matrix.os }} | |
| cp zeroj-verifier-halo2/halo2-rust/target/release/${{ matrix.lib }} \ | |
| zeroj-verifier-halo2/src/main/resources/native/${{ matrix.os }}/ | |
| - name: Upload native library | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: halo2-native-${{ matrix.os }} | |
| path: zeroj-verifier-halo2/src/main/resources/native/${{ matrix.os }}/${{ matrix.lib }} | |
| retention-days: 1 | |
| # ================================================================ | |
| # Stage 2: Build and test Java with all native libraries bundled | |
| # ================================================================ | |
| build-and-test: | |
| name: Build & Test | |
| needs: [ build-gnark-native, build-halo2-native ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java 25 (GraalVM) | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '25' | |
| distribution: 'graalvm' | |
| # Download all gnark native libs into the resource directory | |
| - name: Download gnark native (linux-x86_64) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnark-native-linux-x86_64 | |
| path: zeroj-prover-gnark/src/main/resources/native/linux-x86_64/ | |
| - name: Download gnark native (linux-arm64) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnark-native-linux-arm64 | |
| path: zeroj-prover-gnark/src/main/resources/native/linux-arm64/ | |
| - name: Download gnark native (macos-arm64) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnark-native-macos-arm64 | |
| path: zeroj-prover-gnark/src/main/resources/native/macos-arm64/ | |
| # Download all halo2 native libs into the resource directory | |
| - name: Download halo2 native (linux-x86_64) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: halo2-native-linux-x86_64 | |
| path: zeroj-verifier-halo2/src/main/resources/native/linux-x86_64/ | |
| - name: Download halo2 native (linux-arm64) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: halo2-native-linux-arm64 | |
| path: zeroj-verifier-halo2/src/main/resources/native/linux-arm64/ | |
| - name: Download halo2 native (macos-arm64) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: halo2-native-macos-arm64 | |
| path: zeroj-verifier-halo2/src/main/resources/native/macos-arm64/ | |
| - name: Verify native libraries are in place | |
| run: | | |
| echo "=== gnark native libraries ===" | |
| find zeroj-prover-gnark/src/main/resources/native -type f | |
| echo "=== halo2 native libraries ===" | |
| find zeroj-verifier-halo2/src/main/resources/native -type f | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build and test | |
| run: ./gradlew build -PskipSigning=true --stacktrace | |
| env: | |
| GOMAXPROCS: '2' | |
| - name: Upload test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: '**/build/reports/tests/' | |
| retention-days: 14 | |
| # ================================================================ | |
| # Stage 3: Platform-specific test (run gnark/halo2 tests natively) | |
| # ================================================================ | |
| platform-test: | |
| name: Test (${{ matrix.os }}) | |
| needs: [ build-gnark-native, build-halo2-native ] | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: linux-x86_64 | |
| runner: ubuntu-latest | |
| - os: macos-arm64 | |
| runner: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java 25 (GraalVM) | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '25' | |
| distribution: 'graalvm' | |
| - name: Download gnark native | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnark-native-${{ matrix.os }} | |
| path: zeroj-prover-gnark/src/main/resources/native/${{ matrix.os }}/ | |
| - name: Download halo2 native | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: halo2-native-${{ matrix.os }} | |
| path: zeroj-verifier-halo2/src/main/resources/native/${{ matrix.os }}/ | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run all tests | |
| run: ./gradlew test -PskipSigning=true --stacktrace | |
| env: | |
| GOMAXPROCS: '2' |