Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 70 additions & 0 deletions .github/workflows/rust-lite-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: rust-lite-ci

on:
pull_request:
paths:
- "rust/**"
- "lite-rs/**"
- "docs/rust-lite-parity-proof.md"
- "scripts/parity-lite.py"
- "scripts/parity-lite.sh"
- "scripts/smoke-rust-lite.sh"
- ".github/workflows/rust-lite-*.yml"
merge_group:

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

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- run: cargo fmt --manifest-path rust/Cargo.toml --all --check
- run: cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- run: cargo test --manifest-path rust/Cargo.toml --all-targets

check-windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- run: cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings

parity:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: bash scripts/parity-lite.sh
73 changes: 73 additions & 0 deletions .github/workflows/rust-lite-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: rust-lite-release

on:
push:
tags: ["rust-lite-v*"]

permissions:
contents: write

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: tag and pins match Cargo.toml
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' rust/Cargo.toml | head -1)
test "rust-lite-v$version" = "${GITHUB_REF_NAME}"
test "$version" = "$(tr -d '[:space:]' < lite-rs/herdr-annotate.version)"

build:
needs: verify
strategy:
fail-fast: false
matrix:
include:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04-arm }
- { target: x86_64-apple-darwin, os: macos-15-intel }
- { target: aarch64-apple-darwin, os: macos-15 }
- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: aarch64-pc-windows-msvc, os: windows-11-arm }
runs-on: ${{ matrix.os }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
key: ${{ matrix.target }}
- run: cargo build --manifest-path rust/Cargo.toml --release --target ${{ matrix.target }}
- name: name asset by target
shell: bash
run: |
mkdir -p dist
if [ "${{ runner.os }}" = "Windows" ]; then
cp "rust/target/${{ matrix.target }}/release/herdr-annotate.exe" "dist/herdr-annotate-${{ matrix.target }}.exe"
else
cp "rust/target/${{ matrix.target }}/release/herdr-annotate" "dist/herdr-annotate-${{ matrix.target }}"
fi
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: dist/*
if-no-files-found: error

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: checksums
run: cd dist && sha256sum herdr-annotate-* > SHA256SUMS && cat SHA256SUMS
- name: publish evaluation binaries
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" --prerelease --title "${GITHUB_REF_NAME}" --generate-notes dist/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ node_modules/
.DS_Store
bin/*
!bin/.gitkeep
/rust/target/
/lite-rs/bin/*
!/lite-rs/bin/.gitkeep
Loading
Loading