From f5358cfd0356fba4416c44b9c7d95820a1b11d43 Mon Sep 17 00:00:00 2001 From: Sergej Date: Tue, 16 Apr 2024 20:53:39 +0200 Subject: [PATCH] fixes --- .github/workflows/basic.yml | 58 +----------------------------- .github/workflows/dependencies.yml | 25 +++++++++++++ .github/workflows/smoke.yml | 37 +++++++++++++++++++ 3 files changed, 63 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/dependencies.yml create mode 100644 .github/workflows/smoke.yml diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index a60030da..3f6a2ef9 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -25,10 +25,6 @@ jobs: restore-keys: | ${{ runner.os }}-${{ github.event.pull_request.head.repo.default_branch }}- ${{ runner.os }}- - - name: Setup common environment - run: | - echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV - cargo install --git https://github.com/paritytech/psvm psvm fmt: needs: prepare @@ -51,60 +47,8 @@ jobs: run: | source $HOME/.cargo/env rustup default nightly + echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV - name: Cargo clippy run: cargo clippy -- -D warnings - name: Check Code run: cargo check - - check-dependencies: - needs: prepare - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Check Dependency Versions - run: | - chmod +x ./scripts/check-dependency-versions.sh - ./scripts/check-dependency-versions.sh - - code_coverage: - needs: prepare - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Setup Rust environment - run: | - source $HOME/.cargo/env - rustup default nightly - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - version: "0.21.0" - - name: Upload to codecov.io - uses: codecov/codecov-action@v3.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - name: Archive code coverage results - uses: actions/upload-artifact@v3.1.0 - with: - name: code-coverage-report - path: cobertura.xml - - block-production: - needs: prepare - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Zombienet setup - run: | - wget https://github.com/paritytech/zombienet/releases/download/v1.3.100/zombienet-linux-x64 - chmod +x zombienet-linux-x64 - yes 2>/dev/null | ./zombienet-linux-x64 setup polkadot - echo "PATH=$GITHUB_WORKSPACE:$PATH" >> $GITHUB_ENV - - name: Compile regionx-node - run: | - cargo build --release - cp ./target/release/regionx-node . - - name: Run smoke test 0001 - run: ./zombienet-linux-x64 -p native test ./zombienet_tests/0001-smoke-test.zndsl diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml new file mode 100644 index 00000000..22392a4d --- /dev/null +++ b/.github/workflows/dependencies.yml @@ -0,0 +1,25 @@ +name: Dependency checks + +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +jobs: + check-dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + + - name: Install Rust + run: cargo install --git https://github.com/paritytech/psvm psvm + - name: Check Dependency Versions + run: | + chmod +x ./scripts/check-dependency-versions.sh + ./scripts/check-dependency-versions.sh diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml new file mode 100644 index 00000000..6ab0c602 --- /dev/null +++ b/.github/workflows/smoke.yml @@ -0,0 +1,37 @@ +name: Smoke tests + +# Controls when the action will run. +on: + workflow_dispatch: + +jobs: + smoke: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - uses: ./.github/actions/setup + + - name: Zombienet setup + run: | + wget https://github.com/paritytech/zombienet/releases/download/v1.3.100/zombienet-linux-x64 + chmod +x zombienet-linux-x64 + yes 2>/dev/null | ./zombienet-linux-x64 setup polkadot || true + echo $GITHUB_WORKSPACE + echo "PATH=$GITHUB_WORKSPACE:$PATH" >> $GITHUB_ENV + echo $PATH + - name: Pull Docker Image + run: docker pull szegoo/regionx-node:latest + + - name: Compile regionx-node + run: | + cargo build --release + cp ./target/release/regionx-node . + + - name: Run smoke test 0001 + run: ./zombienet-linux-x64 -p native test ./zombienet_tests/0001-smoke-test.zndsl