From fac54c1c1df3913af628c5b943b4d0ac980f12f7 Mon Sep 17 00:00:00 2001 From: nikvolf Date: Tue, 16 Jul 2024 10:55:25 +0300 Subject: [PATCH] Make ethexe work in master --- .github/workflows/CI-docker-gear.yml | 2 +- .github/workflows/CI.yaml | 86 ++++++++----------- .github/workflows/PR.yml | 112 +++++++++++-------------- .github/workflows/Update-Vara-Prod.yml | 2 +- .github/workflows/Update-testnet.yml | 2 +- .github/workflows/build.yml | 5 ++ .github/workflows/validation.yml | 2 +- Makefile | 2 +- _typos.toml | 5 +- utils/crates-io/src/handler.rs | 2 +- 10 files changed, 98 insertions(+), 122 deletions(-) diff --git a/.github/workflows/CI-docker-gear.yml b/.github/workflows/CI-docker-gear.yml index 71c5880a894..19d1c55f546 100644 --- a/.github/workflows/CI-docker-gear.yml +++ b/.github/workflows/CI-docker-gear.yml @@ -62,7 +62,7 @@ jobs: fi - name: Build and push Docker image - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v5 with: file: ./docker/Dockerfile-release push: true diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 96e97a179c9..68d10460a56 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -1,8 +1,11 @@ name: CI on: + schedule: + - cron: "0 3 * * *" push: branches: [ master ] + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,58 +19,41 @@ env: jobs: check: - runs-on: [kuberunner, github-runner-01] + uses: ./.github/workflows/check.yml + + build: + uses: ./.github/workflows/build.yml + with: + macos: true + win-native: true + release: true + production: true + + upload: + if: github.event_name == 'push' && github.ref_name == 'master' + runs-on: ubuntu-latest + needs: build steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - submodules: recursive - - - name: "Install: Rust toolchain" - uses: dsherret/rust-toolchain-file@v1 - - - name: "Install: Foundry" - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly + - name: Download artifacts + uses: actions/download-artifact@v4 - - name: "Install: Node.js" - uses: actions/setup-node@v4 + - name: Delete previous release + uses: dev-drprasad/delete-tag-and-release@v1.1 with: - node-version: 20.x - - - name: "Show: Versioning" - run: | - ./scripts/gear.sh show - forge --version - - - name: "Check: ethexe contracts" - run: | - cd ethexe/contracts - forge fmt --check - forge build --sizes - forge test -vvv - - - name: "Check: workspace formatting" - run: ./scripts/gear.sh format gear --check + delete_release: true + tag_name: build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Check: ethexe clippy allowing unused code" - run: cargo clippy -p "ethexe-*" --all-targets --locked -- --no-deps -D warnings + - name: Sleep + run: sleep 10 - - name: "Build: ethexe" - run: cargo build --release -p ethexe-cli - - - name: "Test: ethexe CLI" - run: cargo test --release -p ethexe-cli - - - name: "Test: ethexe Network" - run: cargo test --release -p ethexe-network - - - name: "Test: ethexe Db" - run: cargo test --release -p ethexe-db - - - name: "Test: ethexe Observer" - run: cargo test --release -p ethexe-observer - - - name: "Test: ethexe processor" - run: cargo test --release -p ethexe-processor + - name: Upload + uses: softprops/action-gh-release@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + prerelease: true + tag_name: build + draft: false + fail_on_unmatched_files: true + files: artifact/* diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 40b1aeee78b..7730b2fb9a5 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -15,80 +15,62 @@ env: BINARYEN_VERSION: version_111 jobs: - dynamic-profiles: + status: runs-on: ubuntu-latest outputs: - profiles: ${{ steps.set-matrix.outputs.profiles }} - steps: - - id: set-matrix - run: | - profiles='{"name": "debug", "flags": ""}' - if [ "${{ inputs.release }}" = "true" ]; then - profiles+=', {"name": "release", "flags": "--release"}' - fi - profiles="[${profiles}]" - echo "Profiles: ${profiles}" - echo "profiles=${profiles}" >> $GITHUB_OUTPUT - - check: - runs-on: [kuberunner, github-runner-02] - needs: dynamic-profiles - strategy: - matrix: - profiles: ${{ fromJson(needs.dynamic-profiles.outputs.profiles) }} - fail-fast: false - name: check-linux (${{ matrix.profiles.name }}) + build: ${{ steps.config.outputs.build }} + check: ${{ steps.config.outputs.check }} + win-native: ${{ steps.config.outputs.win-native }} + macos: ${{ steps.config.outputs.macos }} + validator: ${{ steps.config.outputs.validator }} + release: ${{ steps.config.outputs.release }} + production: ${{ steps.config.outputs.production }} steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - submodules: recursive - - name: "Install: Rust toolchain" - uses: dsherret/rust-toolchain-file@v1 + - run: npm install + working-directory: .github/actions/message - - name: "Install: Foundry" - uses: foundry-rs/foundry-toolchain@v1 + - name: Configure + id: config + uses: ./.github/actions/message with: - version: nightly + token: ${{ secrets.GITHUB_TOKEN }} - - name: "Install: Node.js" - uses: actions/setup-node@v4 + docs: + permissions: + contents: write + runs-on: ubuntu-latest + env: + RUSTUP_HOME: /tmp/rustup_home + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/docs with: - node-version: 20.x - - - name: "Show: Versioning" - run: | - ./scripts/gear.sh show - forge --version - - - name: "Check: ethexe contracts" - run: | - cd ethexe/contracts - forge fmt --check - forge build --sizes - forge test -vvv + github_token: ${{ secrets.GITHUB_TOKEN }} - - name: "Check: workspace formatting" - run: ./scripts/gear.sh format gear --check - - - name: "Check: ethexe clippy allowing unused code" - run: cargo clippy -p "ethexe-*" --all-targets --locked -- --no-deps -D warnings - - - name: "Build: ethexe" - run: cargo build --release -p ethexe-cli - - - name: "Test: ethexe CLI" - run: cargo test --release -p ethexe-cli - - - name: "Test: ethexe Network" - run: cargo test --release -p ethexe-network - - - name: "Test: ethexe Db" - run: cargo test --release -p ethexe-db - - - name: "Test: ethexe Observer" - run: cargo test --release -p ethexe-observer - - - name: "Test: ethexe processor" - run: cargo test --release -p ethexe-processor + check: + needs: status + if: ${{ needs.status.outputs.check == 'true' }} + uses: ./.github/workflows/check.yml + + build: + needs: status + if: ${{ needs.status.outputs.build == 'true' }} + uses: ./.github/workflows/build.yml + with: + macos: ${{ needs.status.outputs.macos == 'true' }} + win-native: ${{ needs.status.outputs.win-native == 'true' }} + release: ${{ needs.status.outputs.release == 'true' }} + production: ${{ needs.status.outputs.production == 'true' }} + + validator: + needs: status + if: ${{ needs.status.outputs.validator == 'true' }} + uses: ./.github/workflows/validation.yml + secrets: + VARA_VALIDATOR_8: ${{ secrets.VARA_VALIDATOR_8 }} + SSH_VARA_USERNAME: ${{ secrets.SSH_VARA_USERNAME }} + VARA_SSH_PRIVATE_KEY: ${{ secrets.VARA_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/Update-Vara-Prod.yml b/.github/workflows/Update-Vara-Prod.yml index 6b8de9d399b..1838c71c749 100644 --- a/.github/workflows/Update-Vara-Prod.yml +++ b/.github/workflows/Update-Vara-Prod.yml @@ -41,7 +41,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v5 with: context: . file: ./docker/Vara-Dockerfile diff --git a/.github/workflows/Update-testnet.yml b/.github/workflows/Update-testnet.yml index b8819c6445c..d824af06b7c 100644 --- a/.github/workflows/Update-testnet.yml +++ b/.github/workflows/Update-testnet.yml @@ -41,7 +41,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v5 with: context: . file: ./docker/Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d40ee037630..467564f40bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,6 +75,11 @@ jobs: - name: "Install: Rust toolchain" uses: dsherret/rust-toolchain-file@v1 + - name: "Install: Foundry" + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + - name: "Show: Versioning" run: ./scripts/gear.sh show diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 8dfbc1fd943..19ac2209347 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -49,7 +49,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v5 with: context: . file: ./docker/Dockerfile diff --git a/Makefile b/Makefile index 0dcc8a43ec1..83306bb90ce 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ gpu-pre-commit: @ echo " > Formatting eGPU" && cargo +nightly fmt --all -- --config imports_granularity=Crate,edition=2021 @ echo " >> Clippy checking eGPU" && cargo clippy -p "ethexe-*" --all-targets --all-features -- --no-deps -D warnings -# Bulding contracts +# Building contracts .PHONY: gpu-contracts-pre-commit gpu-contracts-pre-commit: @ echo " > Cleaning contracts" && forge clean --root ethexe/contracts diff --git a/_typos.toml b/_typos.toml index 434de787b23..afe49556136 100644 --- a/_typos.toml +++ b/_typos.toml @@ -5,7 +5,10 @@ extend-ignore-re = [ ] [files] -extend-exclude = ["gsdk/src/metadata/generated.rs"] +extend-exclude = [ + "gsdk/src/metadata/generated.rs", + "ethexe/ethereum/*.json" +] [default.extend-words] overlayed = "overlayed" # typo in sp-state-machine, won't fix. diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index d86b18362a2..9293687620f 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -286,7 +286,7 @@ mod substrate { "sp-crypto-ec-utils" => { table.insert("package", "gp-crypto-ec-utils".into()); } - _ => {} + _ => return, } table.remove("branch");