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

Update base version to v0.3.0 #11

Merged
merged 16 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from 15 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
23 changes: 23 additions & 0 deletions .github/scripts/compliance_parser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Check for xml output file
if [ -f "$1" ]; then
echo "$1 exists."
else
echo "$1 does not exist."
exit 1
fi
# Parse the XML data
errors=$(xmllint --xpath 'string(//testsuite/@errors)' "$1")
failures=$(xmllint --xpath 'string(//testsuite/@failures)' "$1")
test_count=$(xmllint --xpath 'string(//testsuite/@tests)' "$1")

# Check if there are any errors or failures
if [[ $errors -gt 0 || $failures -gt 0 ]]; then
echo "ERROR: Tests failed!"
echo "$failures tests failed, $errors errors. out of $test_count tests"
exit 1
else
echo "SUCCESS: All tests passed!"
echo "$test_count tests passed."
fi
29 changes: 12 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- main
pull_request:

env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

name: ci
jobs:
lint:
Expand Down Expand Up @@ -32,29 +35,21 @@ jobs:
# Build to generate the ABI bindings.

- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --all-features
run: |
cargo build --all --all-features

- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all --all-features
run: |
cargo check --all --all-features

- name: cargo +nightly fmt
uses: actions-rs/cargo@v1
with:
command: fmt
toolchain: nightly
args: --all --check
run: |
cargo +nightly fmt --all --check

- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --all-features --tests -- -D warnings
run: |
cargo clippy --all --all-features --tests -- \
-D warnings

- name: buf setup
uses: bufbuild/buf-setup-action@v1
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/compliance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches:
- main
pull_request:

name: compliance
jobs:
compliance:
runs-on: ubuntu-latest
steps:
- run: curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -
- run: pip install jq yq
- run: sudo apt install -y libxml2-utils


- name: Checkout Rundler
uses: actions/checkout@v4
with:
path: rundler
submodules: recursive

- name: Clone Test Executor
uses: actions/checkout@v4
with:
path: bundler-test-executors
repository: bobanetwork/bundler-test-executor
ref: hc-dev

- name: Build rundler image locally
run: docker buildx build ./rundler -t alchemyplatform/rundler:latest

- name: Run bundle executor
run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml

- name: Parse spec results
run: ./rundler/.github/scripts/compliance_parser.sh ./bundler-test-executors/build/out/rundler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
rundler-hc:
name: Publish rundler-hc
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
offchain-rpc:
name: Publish offchain-rpc
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/docker-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docker release

on:
workflow_dispatch:
inputs:
version:
required: true
type: string
push:
tags:
- v*.*.*

env:
CARGO_TERM_COLOR: always
DOCKER_IMAGE_NAME: alchemyplatform/rundler

jobs:
build:
name: build and push
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
toolchain: 1.79.0

- name: Install toolchain (nightly)
run: rustup toolchain add nightly --component rustfmt --profile minimal

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- uses: taiki-e/install-action@cross

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: alchemyplatform
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker builder
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
docker buildx create --use --name cross-builder

- name: Build and push image
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
sudo -E env "PATH=$PATH" make GIT_TAG="${{ github.event.inputs.version }}" docker-build
else
sudo -E env "PATH=$PATH" make docker-build-latest
fi
Loading
Loading