Skip to content

CI workflow improvements #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Apr 17, 2024
1 change: 1 addition & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -15,5 +15,6 @@ runs:
rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add rustfmt --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup default nightly
rustup show
shell: bash
4 changes: 4 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
fmt:
4 changes: 4 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@ name: Benchmarks
on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
benchmark:
runs-on: ubuntu-22.04
48 changes: 48 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test coverage

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:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
TARPAULIN_VERSION: 0.27.3

jobs:
coverage:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/setup

- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.GH_TOKEN }}

- name: Use Git CLI for Cargo
run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV

- name: Run cargo-tarpaulin
run: |
wget https://github.com/xd009642/tarpaulin/releases/download/${{ env.TARPAULIN_VERSION }}/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz
tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin
cargo tarpaulin --workspace \
-e regionx-node regionx-runtime \
--exclude-files **/mock.rs **/weights/* \
--out xml

- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -10,6 +10,10 @@ on:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-dependencies:
runs-on: ubuntu-latest
@@ -18,11 +22,7 @@ jobs:
- uses: ./.github/actions/setup

- name: Install Rust
run: |
rustup show
rustup toolchain install nightly
cargo install --git https://github.com/paritytech/psvm psvm

run: cargo install --git https://github.com/paritytech/psvm psvm
- name: Check Dependency Versions
run: |
chmod +x ./scripts/check-dependency-versions.sh
24 changes: 12 additions & 12 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -4,17 +4,23 @@ name: Smoke tests
on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
smoke:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- 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
@@ -23,19 +29,13 @@ jobs:
echo $GITHUB_WORKSPACE
echo "PATH=$GITHUB_WORKSPACE:$PATH" >> $GITHUB_ENV
echo $PATH

- name: Pull Docker Image
run: docker pull szegoo/regionx-node:latest

- name: Create Container
id: create-container
run: |
container_id=$(docker create szegoo/regionx-node:latest)
echo "::set-output name=container_id::$container_id"

- name: Copy Executable from Container
run: |
docker cp ${{ steps.create-container.outputs.container_id }}:/usr/bin/regionx-node .

- 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
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@ name: Tests
on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-22.04
4 changes: 4 additions & 0 deletions .github/workflows/try_runtime.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@ name: Try-runtime
on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
try-runtime:
runs-on: ubuntu-22.04
Loading