Skip to content

Commit

Permalink
Make ethexe work in master
Browse files Browse the repository at this point in the history
  • Loading branch information
NikVolf committed Jul 16, 2024
1 parent b672f14 commit fac54c1
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI-docker-gear.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
86 changes: 36 additions & 50 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: CI

on:
schedule:
- cron: "0 3 * * *"
push:
branches: [ master ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -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/[email protected]
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/*
112 changes: 47 additions & 65 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/Update-Vara-Prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Update-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion utils/crates-io/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ mod substrate {
"sp-crypto-ec-utils" => {
table.insert("package", "gp-crypto-ec-utils".into());
}
_ => {}
_ => return,
}

table.remove("branch");
Expand Down

0 comments on commit fac54c1

Please sign in to comment.