Bump frontier and fix tests (#1208) #640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Checks | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "**.rs" | |
- "**.toml" | |
- "**lock" | |
- "**.json" | |
- "**.yml" | |
pull_request: | |
types: [opened, synchronize, ready_for_review] | |
branches: | |
- main | |
paths: | |
- "**.rs" | |
- "**.ts" | |
- "**.toml" | |
- "**lock" | |
- "**.json" | |
- "**.yml" | |
env: | |
CARGO_INCREMENTAL: 1 | |
CARGO_TERM_COLOR: always | |
GITHUB_CACHE_VERSION: 2 | |
RUST_BACKTRACE: full | |
jobs: | |
basic-checks: | |
name: Task ${{ matrix.action }} darwinia | |
if: github.event_name == 'push' || !github.event.pull_request.draft | |
needs: [features-checks] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
action: [build, test] | |
steps: | |
- name: Setup build environment | |
run: sudo apt install -y protobuf-compiler | |
- name: Fetch latest code | |
uses: actions/checkout@v3 | |
- name: Cache cargo | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: cargo-${{ matrix.action }}-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: cargo-${{ matrix.action }}-${{ env.GITHUB_CACHE_VERSION }}- | |
- name: Action ${{ matrix.action }} | |
if: matrix.action != 'test' | |
run: cargo ${{ matrix.action }} --release --locked -p darwinia --all-features | |
- name: Action ${{ matrix.action }} | |
if: matrix.action == 'test' | |
run: SKIP_WASM_BUILD=1 cargo ${{ matrix.action }} --release --locked --features all-natives | |
- name: Change path | |
if: matrix.action != 'test' | |
run: mv target/release/darwinia . | |
- name: Upload | |
if: matrix.action != 'test' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: darwinia | |
path: darwinia | |
- name: Shrink cache | |
run: .github/shrink-cache.sh | |
format-checks: | |
name: Task check format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch latest code | |
uses: actions/checkout@v3 | |
- name: Check format | |
run: cargo fmt --all -- --check | |
- name: Fast fail | |
uses: vishnudxb/[email protected] | |
if: failure() | |
with: | |
repo: darwinia-network/darwinia | |
workflow_id: ${{ github.run_id }} | |
access_token: ${{ github.token }} | |
features-checks: | |
name: Task check features | |
if: github.event_name == 'push' || !github.event.pull_request.draft | |
strategy: | |
matrix: | |
runtime: | |
[runtime/darwinia, runtime/crab, runtime/pangoro, runtime/pangolin] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check ${{ matrix.runtime }} | |
uses: hack-ink/[email protected] | |
with: | |
path: ${{ matrix.runtime }} | |
runtime-checks: | |
name: Task check runtimes | |
if: github.event_name == 'push' || !github.event.pull_request.draft | |
strategy: | |
matrix: | |
target: | |
[ | |
{ | |
chain: darwinia-dev, | |
compare-with: "https://rpc.darwinia-network", | |
}, | |
{ | |
chain: crab-dev, | |
compare-with: "https://crab-rpc.darwinia-network", | |
}, | |
{ | |
chain: pangoro-dev, | |
compare-with: "https://pangoro-rpc.darwinia.network", | |
}, | |
{ | |
chain: pangolin-dev, | |
compare-with: "https://pangolin-rpc.darwinia.network", | |
}, | |
] | |
needs: [basic-checks] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check ${{ matrix.target.chain }} | |
uses: hack-ink/[email protected] | |
with: | |
uploaded-artifact: darwinia | |
chain: ${{ matrix.target.chain }} | |
compare-with: ${{ matrix.target.compare-with }} | |
evm-checks: | |
name: Task check EVM | |
if: github.event_name == 'push' || !github.event.pull_request.draft | |
needs: [basic-checks] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download darwinia | |
uses: actions/download-artifact@v2 | |
with: | |
name: darwinia | |
- name: Install darwinia | |
run: | | |
chmod u+x darwinia | |
sudo mv darwinia /usr/bin | |
- name: Launch darwinia | |
run: darwinia --chain pangolin-dev --tmp --alice --tracing-api debug,trace & | |
- name: Install Node 19 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 19 | |
- name: Fetch latest code | |
uses: actions/checkout@v3 | |
- name: Action test | |
run: | | |
cd tests/ethereum | |
npm install | |
npm run test | |
checks-cleaning: | |
name: Task checks cleaning | |
if: always() | |
needs: [features-checks, runtime-checks] | |
steps: | |
- name: Clean artifacts | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: darwinia | |
runs-on: ubuntu-latest |