From c942bcf6cc9f18649e816acd84bd9199c8069f56 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Thu, 21 Dec 2023 11:01:08 -0500 Subject: [PATCH 01/28] feat(cross-arch): add cross arch release pipeline --- .github/workflows/docker-release.yaml | 53 +++++ .github/workflows/release.yaml | 216 ++++++++++++++++++ .gitignore | 3 + Cross.toml | 2 + Dockerfile | 6 +- Dockerfile.build | 18 ++ Dockerfile.cross | 15 ++ Makefile | 37 +++ crates/types/build.rs | 9 - .../rundler-launcher/docker-compose.yml | 2 +- 10 files changed, 348 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/docker-release.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 Cross.toml create mode 100644 Dockerfile.build create mode 100644 Dockerfile.cross diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml new file mode 100644 index 000000000..1e19bb15b --- /dev/null +++ b/.github/workflows/docker-release.yaml @@ -0,0 +1,53 @@ +name: Docker release + +on: + workflow_dispatch: + 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.71.0 + + - name: Install toolchain (nightly) + run: rustup toolchain add nightly --component rustfmt --profile minimal + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + - 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: | + cargo install cross --git https://github.com/cross-rs/cross + sudo -E env "PATH=$PATH" make docker-build-latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..ce4c83f3c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,216 @@ +## This release action is inspired from https://githug.com/paradigmxyz/reth + +name: Release + +on: + push: + tags: + - v*.*.* + +jobs: + extract-version: + name: extract version + runs-on: ubuntu-latest + steps: + - name: Extract version + run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT + id: extract_version + outputs: + VERSION: ${{ steps.extract_version.outputs.VERSION }} + + build: + name: build release + strategy: + matrix: + arch: + [ + aarch64-unknown-linux-gnu, + x86_64-unknown-linux-gnu, + x86_64-apple-darwin, + aarch64-apple-darwin, + x86_64-pc-windows-gnu, + ] + include: + - arch: aarch64-unknown-linux-gnu + platform: ubuntu-latest + profile: maxperf + - arch: x86_64-unknown-linux-gnu + platform: ubuntu-latest + profile: maxperf + - arch: x86_64-apple-darwin + platform: macos-latest + profile: maxperf + - arch: aarch64-apple-darwin + platform: macos-latest + profile: maxperf + - arch: x86_64-pc-windows-gnu + platform: ubuntu-latest + profile: maxperf + + runs-on: ${{ matrix.platform }} + needs: extract-version + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Get latest version of stable Rust + run: rustup update stable + - name: Install target + run: rustup target add ${{ matrix.arch }} + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + # ============================== + # Apple Silicon SDK setup + # ============================== + + - name: Apple Silicon setup + if: ${{ matrix.job.target == 'aarch64-apple-darwin' }} + run: | + echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV + echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV + + # ============================== + # Builds + # ============================== + + - name: Build rundler for ${{ matrix.arch }} + run: | + cargo install cross + env PROFILE=${{ matrix.profile }} make build-${{ matrix.arch }} + + - name: Move cross-compiled binary + if: matrix.arch != 'x86_64-pc-windows-gnu' + run: | + mkdir artifacts + mv target/${{ matrix.arch }}/${{ matrix.profile }}/rundler ./artifacts + + - name: Move cross-compiled binary (Windows) + if: matrix.arch == 'x86_64-pc-windows-gnu' + run: | + mkdir artifacts + mv target/${{ matrix.arch }}/${{ matrix.profile }}/rundler.exe ./artifacts + + # ============================== + # Signing + # ============================== + + - name: Configure GPG and create artifacts + env: + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + export GPG_TTY=$(tty) + echo -n "$GPG_SIGNING_KEY" | gpg --batch --import + cd artifacts + tar -czf rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz rundler* + echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz + mv *tar.gz* .. + shell: bash + + # ======================================================================= + # Upload artifacts + # This is required to share artifacts between different jobs + # ======================================================================= + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz + path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz + + - name: Upload signature + uses: actions/upload-artifact@v3 + with: + name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc + path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc + + draft-release: + name: draft release + needs: [build, extract-version] + runs-on: ubuntu-latest + env: + VERSION: ${{ needs.extract-version.outputs.VERSION }} + permissions: + # Required to post the release + contents: write + steps: + # This is necessary for generating the changelog. It has to come before "Download Artifacts" or else it deletes the artifacts. + - name: Checkout sources + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # ============================== + # Download artifacts + # ============================== + - name: Download artifacts + uses: actions/download-artifact@v3 + + # ============================== + # Create release draft + # ============================== + - name: Generate full changelog + id: changelog + run: | + echo "CHANGELOG<> $GITHUB_OUTPUT + echo "$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }})" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create release draft + env: + GITHUB_USER: ${{ github.repository_owner }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # The formatting here is borrowed from Reth & Lighthouse (which is borrowed from OpenEthereum): + # https://github.com/openethereum/openethereum/blob/main/.github/workflows/build.yml + run: | + body=$(cat <<- "ENDBODY" + + + ## Testing Checklist (DELETE ME) + + - [ ] Run on testnet for 1-3 days. + - [ ] Ensure all CI checks pass. + + ## Release Checklist (DELETE ME) + + - [ ] Ensure all crates have had their versions bumped. + - [ ] Write the summary. + - [ ] Ensure all binaries have been added. + - [ ] Prepare release posts (Twitter, ...). + + ## Summary + + Add a summary, including: + + - Critical bug fixes + - New features + - Any breaking changes (and what to expect) + + ## All Changes + + ${{ steps.changelog.outputs.CHANGELOG }} + + ## Binaries + + The binaries are signed with the PGP key: `85C5 DEF0 37D3 FDE4 FC17 94B1 475B 35EA 9352 EB2` + + | System | Architecture | Binary | PGP Signature | + |:---:|:---:|:---:|:---| + | | x86_64 | [rundler-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz.asc) | + | | aarch64 | [rundler-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz.asc) | + | | x86_64 | [rundler-${{ env.VERSION }}-x86_64-pc-windows-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-pc-windows-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-pc-windows-gnu.tar.gz.asc) | + | | x86_64 | [rundler-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz.asc) | + | | aarch64 | [rundler-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz.asc) | + | | | | | + | **System** | **Option** | - | **Resource** | + | | Docker | [${{ env.VERSION }}](https://hub.docker.com/r/alchemyplatform/rundler) | + + ENDBODY + ) + assets=() + for asset in ./rundler-*.tar.gz*; do + assets+=("-a" "$asset/$asset") + done + tag_name="${{ env.VERSION }}" + echo "$body" | gh release create --draft "${assets[@]}" -F "-" "$tag_name" diff --git a/.gitignore b/.gitignore index d3b0897d5..728fbc633 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ *.profraw .DS_Store .helix + +# Release artifacts +dist/ diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 000000000..76c3e817f --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[build] +dockerfile = "Dockerfile.build" diff --git a/Dockerfile b/Dockerfile index 177fb5e20..095574321 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Adapted from https://github.com/paradigmxyz/reth/blob/main/Dockerfile # syntax=docker/dockerfile:1.4 -FROM rust:1.75.0 AS chef-builder +FROM --platform=$TARGETPLATFORM rust:1.75.0 AS chef-builder # Install system dependencies RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list @@ -50,8 +50,8 @@ WORKDIR /app # install curl for healthcheck RUN apt-get -y update; apt-get -y install curl -# Copy reth over from the build stage +# Copy rundler over from the build stage COPY --from=builder /app/target/release/rundler /usr/local/bin EXPOSE 3000 8080 -CMD ["/usr/local/bin/rundler", "node"] +ENTRYPOINT ["/usr/local/bin/rundler"] diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 000000000..7b8f19e4e --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,18 @@ +ARG CROSS_BASE_IMAGE +# Dockerfile.forge +FROM ghcr.io/foundry-rs/foundry:latest as foundry + +FROM $CROSS_BASE_IMAGE +COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y gnupg2 apt-transport-https ca-certificates software-properties-common +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +RUN mkdir -p /etc/apt/keyrings +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list +RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config protobuf-compiler nodejs yarn +RUN add-apt-repository ppa:ethereum/ethereum +RUN apt-get update +RUN apt-get install -y solc diff --git a/Dockerfile.cross b/Dockerfile.cross new file mode 100644 index 000000000..1b2aa672e --- /dev/null +++ b/Dockerfile.cross @@ -0,0 +1,15 @@ +# This image is meant to enable cross-architecture builds. +# It assumes the rundler binary has already been compiled for `$TARGETPLATFORM` and is +# locatable in `./dist/bin/$TARGETARCH` +FROM --platform=$TARGETPLATFORM ubuntu:22.04 + +LABEL org.opencontainers.image.source=https://github.com/alchemyplatform/rundler +LABEL org.opencontainers.image.licenses="GNU Lesser General Public License v3.0" + +# Filled by docker buildx +ARG TARGETARCH + +COPY ./dist/bin/$TARGETARCH/rundler /usr/local/bin/rundler + +EXPOSE 3000 8080 +ENTRYPOINT ["/usr/local/bin/rundler"] diff --git a/Makefile b/Makefile index 75357566d..4765a4b0f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,11 @@ ##@ Test UNIT_TEST_ARGS := --locked --workspace --all-features +PROFILE ?= release +DOCKER_IMAGE_NAME ?= alchemyplatform/rundler +BIN_DIR = "dist/bin" +BUILD_PATH = "target" +GIT_TAG ?= $(shell git describe --tags --abbrev=0) .PHONY: build build: ## Build the project. @@ -28,8 +33,40 @@ test-spec-integrated: ## Run spec tests in integrated mode .PHONY: test-spec-modular test-spec-modular: ## Run spec tests in modular mode test/spec-tests/remote/run-spec-tests.sh + +.PHONY: submodule-update +submodule-update: ## Update git submodules + git submodule update + +build-%: + cross build --bin rundler --target $* --profile "$(PROFILE)" .PHONY: fmt fmt: ## format code with nightly rust cargo +nightly fmt +# Note: This requires a buildx builder with emulation support. For example: +# +# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64` +# `docker buildx create --use --driver docker-container --name cross-builder` +.PHONY: docker-build-latest +docker-build-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`. + $(call build_docker_image,$(GIT_TAG),latest) + +# Create a cross-arch Docker image with the given tags and push it +define build_docker_image + $(MAKE) build-aarch64-unknown-linux-gnu + mkdir -p $(BIN_DIR)/arm64 + cp $(BUILD_PATH)/aarch64-unknown-linux-gnu/$(PROFILE)/rundler $(BIN_DIR)/arm64/rundler + + $(MAKE) build-x86_64-unknown-linux-gnu + mkdir -p $(BIN_DIR)/amd64 + cp $(BUILD_PATH)/x86_64-unknown-linux-gnu/$(PROFILE)/rundler $(BIN_DIR)/amd64/rundler + + docker buildx build --file ./Dockerfile.cross . \ + --platform linux/arm64,linux/amd64 \ + --tag $(DOCKER_IMAGE_NAME):$(1) \ + --tag $(DOCKER_IMAGE_NAME):$(2) \ + --provenance=false +endef + diff --git a/crates/types/build.rs b/crates/types/build.rs index fc8a0aa34..e17d94b01 100644 --- a/crates/types/build.rs +++ b/crates/types/build.rs @@ -19,7 +19,6 @@ fn main() -> Result<(), Box> { println!("cargo:rerun-if-changed=contracts/lib"); println!("cargo:rerun-if-changed=contracts/src"); println!("cargo:rerun-if-changed=contracts/foundry.toml"); - update_submodules()?; generate_contract_bindings()?; Ok(()) } @@ -64,14 +63,6 @@ fn generate_abis() -> Result<(), Box> { ) } -fn update_submodules() -> Result<(), Box> { - run_command( - Command::new("git").arg("submodule").arg("update"), - "https://github.com/git-guides/install-git", - "update submodules", - ) -} - fn run_command( command: &mut Command, install_page_url: &str, diff --git a/test/spec-tests/launchers/rundler-launcher/docker-compose.yml b/test/spec-tests/launchers/rundler-launcher/docker-compose.yml index 09f931a59..9032037a9 100644 --- a/test/spec-tests/launchers/rundler-launcher/docker-compose.yml +++ b/test/spec-tests/launchers/rundler-launcher/docker-compose.yml @@ -6,7 +6,7 @@ services: ports: - "3000:3000" - "8080:8080" - command: bash -c "/usr/local/bin/rundler node" + command: node environment: - RUST_LOG=debug - ENTRY_POINTS=0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 From 1c8adda5fb8e9e41dbd733ba3e60ae94f9c017c7 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Thu, 21 Dec 2023 14:01:58 -0500 Subject: [PATCH 02/28] feat(ci): add a new function --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4765a4b0f..c176f6a86 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,10 @@ fmt: ## format code with nightly rust docker-build-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`. $(call build_docker_image,$(GIT_TAG),latest) +.PHONY: docker-build +docker-build: ## Build and push a cross-arch Docker image + $(call build_docker_image,$(GIT_TAG)) + # Create a cross-arch Docker image with the given tags and push it define build_docker_image $(MAKE) build-aarch64-unknown-linux-gnu @@ -66,7 +70,7 @@ define build_docker_image docker buildx build --file ./Dockerfile.cross . \ --platform linux/arm64,linux/amd64 \ --tag $(DOCKER_IMAGE_NAME):$(1) \ - --tag $(DOCKER_IMAGE_NAME):$(2) \ + $(if $(2),--tag $(DOCKER_IMAGE_NAME):$(2)) \ --provenance=false endef From 336250bf014096449e464a6621716a22a0fb16d8 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 16 Jan 2024 10:29:00 -0500 Subject: [PATCH 03/28] feat(ci): add workflow dispatch to binary build --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ce4c83f3c..c7f5f2e27 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,7 @@ name: Release on: + workflow_dispatch: push: tags: - v*.*.* From 69687958fa144ba95c1a7080c32a4c57de1e970d Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 30 Jan 2024 18:11:03 -0500 Subject: [PATCH 04/28] feat(release): test commit --- docs/docker.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/docker.md b/docs/docker.md index 243df9224..d4e02208a 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -31,3 +31,8 @@ services: ``` An example docker-compose configuration running Rundler in its distributed mode can be found [here](../test/spec-tests/remote/docker-compose.yml). + +## Cross platform docker builds + +Cross platform builds should only be done when there is a new release automatically by a github action. This is done by first installing +the `tonistiigi/binfmt` package which will install the relevevant cross compliation software needed (qemu, etc.) to compile each image. From 1525ea5389803cf2603ad8433894db0bc60164de Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 30 Jan 2024 18:13:39 -0500 Subject: [PATCH 05/28] feat(release): fix typo --- docs/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker.md b/docs/docker.md index d4e02208a..5ff2aad9a 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -35,4 +35,4 @@ An example docker-compose configuration running Rundler in its distributed mode ## Cross platform docker builds Cross platform builds should only be done when there is a new release automatically by a github action. This is done by first installing -the `tonistiigi/binfmt` package which will install the relevevant cross compliation software needed (qemu, etc.) to compile each image. +the `tonistiigi/binfmt` package which will install the relevevant cross compilation software needed (qemu, etc.) to compile each image. From 6e985ba115867df7b7aacfe0abee5c75ec2272a9 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 31 Jan 2024 10:45:31 -0500 Subject: [PATCH 06/28] feat(release): Add more context to docs --- docs/docker.md | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/docs/docker.md b/docs/docker.md index 5ff2aad9a..8698ee812 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -32,7 +32,48 @@ services: An example docker-compose configuration running Rundler in its distributed mode can be found [here](../test/spec-tests/remote/docker-compose.yml). -## Cross platform docker builds +## Cross-Platform Docker Builds with Docker and cross-rs -Cross platform builds should only be done when there is a new release automatically by a github action. This is done by first installing -the `tonistiigi/binfmt` package which will install the relevevant cross compilation software needed (qemu, etc.) to compile each image. +### Prerequisites + +- [cross-rs](https://github.com/cross-rs/cross) +- [tonistiigi/binfmt](https://github.com/tonistiigi/binfmt) +- [docker-buildx](https://github.com/docker/buildx) + +### Build Phase [Dockerfile.build](../Dockerfile.build) + +This phase compiles and imports required libraries for successful compilation. It uses the Dockerfile.build as an environment. The base image is specified by the `CROSS_BASE_IMAGE` argument. A list of images that `cross-rs` provides can be found [here](https://github.com/cross-rs/cross/tree/main/docker). + +### Release Phase [Dockerfile.cross](../Dockerfile.cross) + +This phase imports the compiled binary from the previous stage into its environment and exposes relevant ports for the correct functioning of the program. The target plaform is specified by the `TARGETPLATFORM` argument. + +### Usage + +GitHub Actions + +``` +jobs: + build: + runs-on: ubuntu-latest + + steps: + - 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: | + cargo install cross --git https://github.com/cross-rs/cross + sudo -E env "PATH=$PATH" make docker-build-latest +``` + +Local Builds + +``` +docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 +docker buildx create --use --name cross-builder +cargo install cross --git https://github.com/cross-rs/cross +sudo -E env "PATH=$PATH" make docker-build-latest +``` From af1d1b058c314fb89d66add9e9db3635f579366d Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 31 Jan 2024 10:46:48 -0500 Subject: [PATCH 07/28] feat(release): make labels build --- docs/docker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docker.md b/docs/docker.md index 8698ee812..009f54e04 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -50,7 +50,7 @@ This phase imports the compiled binary from the previous stage into its environm ### Usage -GitHub Actions +**GitHub Actions** ``` jobs: @@ -69,7 +69,7 @@ jobs: sudo -E env "PATH=$PATH" make docker-build-latest ``` -Local Builds +**Local Builds** ``` docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 From 43293785eb1dc152d30e55f627da75109face53d Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 31 Jan 2024 10:50:51 -0500 Subject: [PATCH 08/28] feat(release): fix typo --- docs/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker.md b/docs/docker.md index 009f54e04..7418b7b64 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -46,7 +46,7 @@ This phase compiles and imports required libraries for successful compilation. I ### Release Phase [Dockerfile.cross](../Dockerfile.cross) -This phase imports the compiled binary from the previous stage into its environment and exposes relevant ports for the correct functioning of the program. The target plaform is specified by the `TARGETPLATFORM` argument. +This phase imports the compiled binary from the previous stage into its environment and exposes relevant ports for the correct functioning of the program. The target platform is specified by the `TARGETPLATFORM` argument. ### Usage From 01fc2e0fe34abbb14c9a2344069eea56022b61c4 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 31 Jan 2024 11:08:20 -0500 Subject: [PATCH 09/28] feat(release): add override for workflow dispatch --- .github/workflows/docker-release.yaml | 11 ++++++++++- .github/workflows/release.yaml | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml index 1e19bb15b..b98abee8d 100644 --- a/.github/workflows/docker-release.yaml +++ b/.github/workflows/docker-release.yaml @@ -2,6 +2,10 @@ name: Docker release on: workflow_dispatch: + inputs: + version: + required: true + type: string push: tags: - v*.*.* @@ -50,4 +54,9 @@ jobs: - name: Build and push image run: | cargo install cross --git https://github.com/cross-rs/cross - sudo -E env "PATH=$PATH" make docker-build-latest + + if [ -n "${{ github.event.inputs.version }}" ]; then + make GIT_TAG=${github.event.inputs.version} docker-build + else + sudo -E env "PATH=$PATH" make docker-build-latest + fi diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c7f5f2e27..cd2595929 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,10 @@ name: Release on: workflow_dispatch: + inputs: + version: + required: true + type: string push: tags: - v*.*.* @@ -14,7 +18,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Extract version - run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT + run: | + if [ -n "${{ github.event.inputs.version }}" ]; then + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT + else + echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT + fi id: extract_version outputs: VERSION: ${{ steps.extract_version.outputs.VERSION }} From 9f61fc56cfcacd4f56bb4ce2294ab5ff1955d67a Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 31 Jan 2024 11:15:40 -0500 Subject: [PATCH 10/28] feat(release): fix typo --- .github/workflows/docker-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml index b98abee8d..1b7125645 100644 --- a/.github/workflows/docker-release.yaml +++ b/.github/workflows/docker-release.yaml @@ -56,7 +56,7 @@ jobs: cargo install cross --git https://github.com/cross-rs/cross if [ -n "${{ github.event.inputs.version }}" ]; then - make GIT_TAG=${github.event.inputs.version} docker-build + make GIT_TAG="${{ github.event.inputs.version }}" docker-build else sudo -E env "PATH=$PATH" make docker-build-latest fi From 6d25d7d9b7502f7e1fb4e4ec0fc98dbe366a1c26 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Thu, 1 Feb 2024 16:40:27 -0500 Subject: [PATCH 11/28] feat(release): add new readme --- docs/README.md | 2 ++ docs/release.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 docs/release.md diff --git a/docs/README.md b/docs/README.md index b51b61da3..c20dea761 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,3 +11,5 @@ [Docker](./docker.md): Instructions for building and running Docker images. [Proto](./proto.md): Protobuf usage and best practices. + +[Releases](./release.md): The release pipeline for the rundler binary diff --git a/docs/release.md b/docs/release.md new file mode 100644 index 000000000..905c8c909 --- /dev/null +++ b/docs/release.md @@ -0,0 +1,39 @@ +# Releases + +The rundler project's releases are seamlessly managed by GitHub Actions and can be accessed here. This comprehensive workflow orchestrates multiple steps to compile and release new versions of the rundler project. + +## Workflow Steps + +# Extract Version + +This initial step intelligently extracts the project version either from GitHub Actions inputs or the Git reference. + +# Build + +The build process is meticulously orchestrated to cater to various architectures and platforms. Employing a dynamic matrix strategy, it defines distinct build configurations encompassing architecture, platform, and profile. Key actions include: + +- Checking out the source code. +- Updating the Rust toolchain. +- Installing the target architecture. +- Leveraging the Swatinem/rust-cache action to efficiently cache Rust dependencies. +- Setting up essential environment variables for Apple Silicon SDK during Apple builds. +- Compiling the project with the specified profile and architecture. +- Organizing the compiled binary into a designated 'artifacts' directory. +- Adapting Windows builds by appending a '.exe' extension to the binary. + +# Signing + +Ensuring the integrity of the release, this step imports the GPG signing key and passphrase securely from GitHub secrets. It then generates GPG signatures for the resulting tarballs, strategically placing them in the root directory. + +# Upload Artifacts + +Leveraging the `actions/upload-artifact` action, this step uploads compressed artifacts along with their corresponding signatures to GitHub Actions. + +# Draft Release + +Dependent on the successful completion of the 'build' and 'extract-version' steps, this final step seamlessly manages the release draft. Actions include: + +- Checking out the source code for the release process. +- Downloading the artifacts necessary for the release. +- Constructing a detailed changelog by extracting commit messages between the current and previous versions. +- Initiating the creation of a draft release on GitHub. The release template includes the changelog and convenient download links for the signed tarballs. From a2f7be84dd1b0cbde91dd73255ad8a2daeadebee Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Thu, 1 Feb 2024 16:43:08 -0500 Subject: [PATCH 12/28] feat(release): add new readme --- docs/release.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/release.md b/docs/release.md index 905c8c909..2f47944a0 100644 --- a/docs/release.md +++ b/docs/release.md @@ -6,16 +6,16 @@ The rundler project's releases are seamlessly managed by GitHub Actions and can # Extract Version -This initial step intelligently extracts the project version either from GitHub Actions inputs or the Git reference. +This initial step conditionally extracts the project version either from GitHub Actions inputs or the Git reference. # Build -The build process is meticulously orchestrated to cater to various architectures and platforms. Employing a dynamic matrix strategy, it defines distinct build configurations encompassing architecture, platform, and profile. Key actions include: +The build process is orchestrated to cater to various architectures and platforms. Using a dynamic matrix strategy, it defines distinct build configurations encompassing architecture, platform, and profile. Key actions include: - Checking out the source code. - Updating the Rust toolchain. - Installing the target architecture. -- Leveraging the Swatinem/rust-cache action to efficiently cache Rust dependencies. +- Leveraging the `Swatinem/rust-cache` action to efficiently cache Rust dependencies. - Setting up essential environment variables for Apple Silicon SDK during Apple builds. - Compiling the project with the specified profile and architecture. - Organizing the compiled binary into a designated 'artifacts' directory. From 6d9a80b682346da9afa5c08d3e7b6e57b9a1cb39 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Mon, 5 Feb 2024 10:34:09 -0500 Subject: [PATCH 13/28] feat(paymaster): fix based on comments --- .github/workflows/docker-release.yaml | 2 +- .github/workflows/release.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml index 1b7125645..f14b14b3a 100644 --- a/.github/workflows/docker-release.yaml +++ b/.github/workflows/docker-release.yaml @@ -58,5 +58,5 @@ jobs: if [ -n "${{ github.event.inputs.version }}" ]; then make GIT_TAG="${{ github.event.inputs.version }}" docker-build else - sudo -E env "PATH=$PATH" make docker-build-latest + make docker-build-latest fi diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cd2595929..c3d7d9c5f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,19 +43,19 @@ jobs: include: - arch: aarch64-unknown-linux-gnu platform: ubuntu-latest - profile: maxperf + profile: release - arch: x86_64-unknown-linux-gnu platform: ubuntu-latest - profile: maxperf + profile: release - arch: x86_64-apple-darwin platform: macos-latest - profile: maxperf + profile: release - arch: aarch64-apple-darwin platform: macos-latest - profile: maxperf + profile: release - arch: x86_64-pc-windows-gnu platform: ubuntu-latest - profile: maxperf + profile: release runs-on: ${{ matrix.platform }} needs: extract-version From 0cceba3b3157b13220b7e3dae3b50289000a927f Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Mon, 5 Feb 2024 10:36:55 -0500 Subject: [PATCH 14/28] feat(paymaster): fix based on comments --- docs/docker.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docker.md b/docs/docker.md index 7418b7b64..2052384b6 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -71,6 +71,9 @@ jobs: **Local Builds** +These command should only be used if you are trying to cross compile the application locally. If you just want to build cross compiled docker images, you should use the commands above. + + ``` docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 docker buildx create --use --name cross-builder From 0ecc16a7e624a8af1b5cb147c1079dee40be0ba0 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 20 Feb 2024 12:59:02 -0500 Subject: [PATCH 15/28] feat(release): add back compliance --- .github/compliance-parser.sh | 16 ++++++++++++ .github/workflows/compliance.yaml | 43 +++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/compliance-parser.sh create mode 100644 .github/workflows/compliance.yaml diff --git a/.github/compliance-parser.sh b/.github/compliance-parser.sh new file mode 100644 index 000000000..154bde9f1 --- /dev/null +++ b/.github/compliance-parser.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# 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 diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml new file mode 100644 index 000000000..22da5e633 --- /dev/null +++ b/.github/workflows/compliance.yaml @@ -0,0 +1,43 @@ +on: + push: + branches: + - main + pull_request: + +name: compliance +jobs: + compliance: + runs-on: ubuntu-latest + steps: + - 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: alchemyplatform/bundler-test-executor + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Setup PDM + uses: pdm-project/setup-pdm@v3 + + - run: pip install jq yq + + - run: which xq + + - run: sudo apt-get install -y libxml2-utils + + - name: Build local docker image + run: docker buildx build ./rundler -t alchemyplatform/rundler:latest + + - name: Run test executor + run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml + + - name: Parse spec results + run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml From 9c32da121d1e19134c69f77b16217283c855a7c5 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 20 Feb 2024 13:22:37 -0500 Subject: [PATCH 16/28] feat(compliance): script excecutable --- .github/compliance-parser.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/compliance-parser.sh diff --git a/.github/compliance-parser.sh b/.github/compliance-parser.sh old mode 100644 new mode 100755 From 0dc7b22ef9c98ee8d52a9b21293e2a09d1478533 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 20 Feb 2024 13:56:36 -0500 Subject: [PATCH 17/28] feat(compliance): change paths --- .github/workflows/compliance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 22da5e633..260530382 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -18,7 +18,7 @@ jobs: - name: Clone Test Executor uses: actions/checkout@v4 with: - path: ./bundler-test-executors + path: bundler-test-executors repository: alchemyplatform/bundler-test-executor - name: Install Foundry From e17bd598816aba473ff85b01129b2a234fb37c34 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 20 Feb 2024 14:38:48 -0500 Subject: [PATCH 18/28] feat(test): show working directory --- .github/workflows/compliance.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 260530382..a74ab51fd 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -27,9 +27,11 @@ jobs: - name: Setup PDM uses: pdm-project/setup-pdm@v3 - - run: pip install jq yq + - run: pwd + + - run: ls -la - - run: which xq + - run: pip install jq yq - run: sudo apt-get install -y libxml2-utils From a3800b2e643924f84d0a7cd96ef47b8d755b96a7 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Tue, 20 Feb 2024 14:41:04 -0500 Subject: [PATCH 19/28] feat(test): use full pasth --- .github/workflows/compliance.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index a74ab51fd..58a7f70dc 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -27,10 +27,6 @@ jobs: - name: Setup PDM uses: pdm-project/setup-pdm@v3 - - run: pwd - - - run: ls -la - - run: pip install jq yq - run: sudo apt-get install -y libxml2-utils @@ -42,4 +38,4 @@ jobs: run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml - name: Parse spec results - run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml + run: ./rundler/.github/compliance-parser.sh /home/runner/work/rundler/rundler/bundler-test-executors/build/out/rundler.xml From 132ea8d77e181300743eac064df3ce843d9aa925 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 21 Feb 2024 09:50:34 -0500 Subject: [PATCH 20/28] feat(spec): list output --- .github/workflows/compliance.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 58a7f70dc..1de6516a4 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -37,5 +37,7 @@ jobs: - name: Run test executor run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml + - run: ls -la ./bundler-test-executors/build/out + - name: Parse spec results run: ./rundler/.github/compliance-parser.sh /home/runner/work/rundler/rundler/bundler-test-executors/build/out/rundler.xml From e8c1b85b1219906414869e6835b8765785f8b29d Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 21 Feb 2024 10:46:42 -0500 Subject: [PATCH 21/28] feat(spec): change path back --- .github/workflows/compliance.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 1de6516a4..976d00a24 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -37,7 +37,5 @@ jobs: - name: Run test executor run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml - - run: ls -la ./bundler-test-executors/build/out - - name: Parse spec results - run: ./rundler/.github/compliance-parser.sh /home/runner/work/rundler/rundler/bundler-test-executors/build/out/rundler.xml + run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml From 330f8dcf424843063482be4db77bcd6c8c5e6dda Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 21 Feb 2024 11:52:54 -0500 Subject: [PATCH 22/28] feat(test): print outputs --- .github/workflows/compliance.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 976d00a24..7eb770c2c 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -37,5 +37,11 @@ jobs: - name: Run test executor run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml + - run: cat ./bundler-test-executors/build/out/rundler.log + + - run: cat ./bundler-test-executors/build/out/index.txt + + - run: cat ./bundler-test-executors/build/out/rundler.txt + - name: Parse spec results run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml From bde209fc12f94201208f70149e9dcfdf92367bdb Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 21 Feb 2024 12:58:45 -0500 Subject: [PATCH 23/28] feat(test): try change dir --- .github/workflows/compliance.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 7eb770c2c..0b227de6e 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -35,13 +35,7 @@ jobs: run: docker buildx build ./rundler -t alchemyplatform/rundler:latest - name: Run test executor - run: ./bundler-test-executors/runall.sh local ./bundler-test-executors/bundlers/rundler/rundler.yml - - - run: cat ./bundler-test-executors/build/out/rundler.log - - - run: cat ./bundler-test-executors/build/out/index.txt - - - run: cat ./bundler-test-executors/build/out/rundler.txt + run: cd bundler-test-executors && runall.sh local ./bundlers/rundler/rundler.yml - name: Parse spec results run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml From cd737e863492be17c5577f685c6dfc5f80481eb4 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 21 Feb 2024 14:54:26 -0500 Subject: [PATCH 24/28] feat(test): try change dir --- .github/workflows/compliance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 0b227de6e..2b8aa816c 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -35,7 +35,7 @@ jobs: run: docker buildx build ./rundler -t alchemyplatform/rundler:latest - name: Run test executor - run: cd bundler-test-executors && runall.sh local ./bundlers/rundler/rundler.yml + run: cd bundler-test-executors && ./runall.sh local ./bundlers/rundler/rundler.yml - name: Parse spec results run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml From fd1536b611b615dea78c14116aa6f2b74f2fc983 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Wed, 21 Feb 2024 15:03:44 -0500 Subject: [PATCH 25/28] feat(test): check xq --- .github/workflows/compliance.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 2b8aa816c..3f8b0baad 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -29,6 +29,8 @@ jobs: - run: pip install jq yq + - run: which xq + - run: sudo apt-get install -y libxml2-utils - name: Build local docker image From 79d0d1b8c3824440d37bb40ece5e99bf070f3a17 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Thu, 22 Feb 2024 16:29:04 -0500 Subject: [PATCH 26/28] feat(release): checkout to 0.6 --- .github/workflows/compliance.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 3f8b0baad..8e03522e0 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -20,6 +20,7 @@ jobs: with: path: bundler-test-executors repository: alchemyplatform/bundler-test-executor + ref: releases/v0.6 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 From 77b689d7a67345c7d3fe84f8e9e2e0a63ba877dd Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Fri, 23 Feb 2024 10:50:33 -0500 Subject: [PATCH 27/28] feat(release): print log --- .github/workflows/compliance.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 8e03522e0..6e204c12d 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -7,7 +7,7 @@ on: name: compliance jobs: compliance: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout Rundler uses: actions/checkout@v4 @@ -40,5 +40,7 @@ jobs: - name: Run test executor run: cd bundler-test-executors && ./runall.sh local ./bundlers/rundler/rundler.yml + - run: cat ./bundler-test-executors/build/out/rundler.log + - name: Parse spec results run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml From 47e4ff65604b5522278b8a8f4437ec91c172848c Mon Sep 17 00:00:00 2001 From: 0xfourzerofour Date: Fri, 23 Feb 2024 11:02:55 -0500 Subject: [PATCH 28/28] feat(compliance): remove runner for now --- .github/compliance-parser.sh | 16 ----------- .github/workflows/compliance.yaml | 46 ------------------------------- 2 files changed, 62 deletions(-) delete mode 100755 .github/compliance-parser.sh delete mode 100644 .github/workflows/compliance.yaml diff --git a/.github/compliance-parser.sh b/.github/compliance-parser.sh deleted file mode 100755 index 154bde9f1..000000000 --- a/.github/compliance-parser.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# 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 diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml deleted file mode 100644 index 6e204c12d..000000000 --- a/.github/workflows/compliance.yaml +++ /dev/null @@ -1,46 +0,0 @@ -on: - push: - branches: - - main - pull_request: - -name: compliance -jobs: - compliance: - runs-on: ubuntu-20.04 - steps: - - 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: alchemyplatform/bundler-test-executor - ref: releases/v0.6 - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Setup PDM - uses: pdm-project/setup-pdm@v3 - - - run: pip install jq yq - - - run: which xq - - - run: sudo apt-get install -y libxml2-utils - - - name: Build local docker image - run: docker buildx build ./rundler -t alchemyplatform/rundler:latest - - - name: Run test executor - run: cd bundler-test-executors && ./runall.sh local ./bundlers/rundler/rundler.yml - - - run: cat ./bundler-test-executors/build/out/rundler.log - - - name: Parse spec results - run: ./rundler/.github/compliance-parser.sh ./bundler-test-executors/build/out/rundler.xml