Skip to content
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

Revamp all CI jobs #439

Merged
merged 16 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,40 @@ on:

jobs:
build:
name: Build Target
runs-on: [self-hosted, builder]
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
components: rust-src

- uses: actions/checkout@v4
- uses: actions/cache@v4

- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
path: target
key: ${{ runner.os }}-target-cache
- run: just build-local runtime-benchmarks
cache-on-failure: true
cache-all-crates: true
key: build

- name: Release build with runtime-benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --release --features runtime-benchmarks

- uses: actions/upload-artifact@v4
with:
name: ${{ github.run_number }}-virto-node
path: ./target/release/virto-node
name: ${{ github.run_number }}-runtime
path: ./target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm

benchmark:
name: Run Benchmarks
needs: build
Expand All @@ -28,18 +48,24 @@ jobs:
pull-requests: write
steps:
- uses: actions/checkout@v4
- run: |

- name: Create `target/release` folder
run: |
mkdir -p .benchmarking-logs target/release

- uses: actions/download-artifact@v4
with:
name: ${{ github.run_number }}-virto-node
name: ${{ github.run_number }}-runtime
path: ./target/release

- run: |
just benchmarks

- uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-benchmark_logs
path: ./.benchmarking-logs

- uses: peter-evans/create-pull-request@v6
with:
add-paths: runtime/kreivo/src/weights
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/check-pr.yml

This file was deleted.

127 changes: 127 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Lint, check, clippy and test

on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Use Nightly with `rustfmt`
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt

- uses: actions/checkout@v4

- name: Check formatting
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check

check:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
components: rust-src

- uses: actions/checkout@v4

- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
key: check

- name: Check Build
uses: actions-rs/cargo@v1
with:
command: check
toolchain: nightly
args: --release --locked --all-features --workspace

clippy:
needs: lint
runs-on: ubuntu-latest
permissions:
checks: write
env:
SKIP_WASM_BUILD: 1
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- name: Use Nightly with `clippy`
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy,rust-src

- uses: actions/checkout@v4

- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
key: check

- name: Annotate with Clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
toolchain: nightly
args: --release --locked --all-features --workspace

test:
needs: lint
runs-on: ubuntu-latest
env:
SKIP_WASM_BUILD: 1
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rust-src

- uses: actions/checkout@v4

- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
key: test

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
toolchain: nightly
args: --lib --release --locked --all-features --workspace
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
lint:
name: Validate PR title for conventional commit compliance
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 0 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,3 @@ jobs:
with:
files: |
release/*

container:
name: Containerize & Publish
needs: build
runs-on: [self-hosted, builder]
steps:
- name: Login to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Publish image
run: |
podman push ghcr.io/virto-network/virto:$(just version)
podman push ghcr.io/virto-network/virto:latest
15 changes: 0 additions & 15 deletions .github/workflows/rust.yml

This file was deleted.

6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ parity-scale-codec = { version = "3.6.4", default-features = false, features = [
scale-info = { version = "2.10.0", default-features = false, features = [
"derive",
] }
serde = { version = "1.0.188", default-features = false, features = ["derive"] }
serde_json = "1.0.121"
serde = { version = "1.0.188", default-features = false }
serde_json = { version = "1.0.121", default-features = false }
smallvec = "1.11"

# Local dependencies
Expand Down
2 changes: 0 additions & 2 deletions chain-spec-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ serde = { workspace = true, features = ["derive"] }
kreivo-runtime = { workspace = true, default-features = true }

cumulus-primitives-core.workspace = true
parachains-common.workspace = true
sp-core.workspace = true
sp-runtime.workspace = true
sc-chain-spec.workspace = true
sc-network.workspace = true
xcm.workspace = true

[features]
runtime-benchmarks = [
Expand Down
44 changes: 0 additions & 44 deletions chain-spec-generator/src/common.rs

This file was deleted.

Loading
Loading