Skip to content

chore: add descriptions to crates (#616) #901

chore: add descriptions to crates (#616)

chore: add descriptions to crates (#616) #901

Workflow file for this run

name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: rust-validation-${{ github.head_ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: full
RUST_LOG: "gadget=trace"
CARGO_TERM_COLOR: always
IN_CI: "true"
jobs:
formatting:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Check Formatting
run: cargo fmt -- --check
linting:
timeout-minutes: 120
name: cargo clippy
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Verify Forge installation
run: forge --version
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: install protobuf and gmp
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libprotobuf-dev libgmp-dev
- name: Run Clippy
run: cargo clippy --tests --examples -- -D warnings
testing:
timeout-minutes: 30
name: cargo test
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
strategy:
fail-fast: false
matrix:
package:
[
# Blueprints
incredible-squaring-blueprint,
incredible-squaring-blueprint-eigenlayer,
# Macros
gadget-blueprint-proc-macro,
gadget-blueprint-proc-macro-core,
gadget-context-derive,
# Clients
gadget-client-eigenlayer,
gadget-client-evm,
gadget-client-tangle,
# Crypto
gadget-crypto-sp-core,
gadget-crypto-ed25519,
gadget-crypto-bls,
gadget-crypto-k256,
gadget-crypto-sr25519,
# Event listeners
gadget-event-listeners-core,
gadget-event-listeners-cronjob,
gadget-blueprint-serde,
gadget-config,
gadget-keystore,
gadget-std,
]
steps:
- name: checkout code
uses: actions/checkout@v2
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Verify Forge installation
run: forge --version
- name: install rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: install protobuf and gmp
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libprotobuf-dev libgmp-dev
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: Add extra args
run: |
# if test == "gadget_context_derive", add --features="networking", else ""
if [[ "${{ matrix.package }}" == "gadget-context-derive" ]]; then
echo "cargo_nextest_args=--features networking" >> $GITHUB_ENV
else
echo "cargo_nextest_args=" >> $GITHUB_ENV
fi
- name: tests
run: cargo nextest run --profile ci --package ${{ matrix.package }} ${{ env.cargo_nextest_args }}
# TODO: nextest doesn't support doc tests yet (https://github.com/nextest-rs/nextest/issues/16)
- name: doc tests
run: cargo test --package ${{ matrix.package }} --doc
macos_tests:
timeout-minutes: 30
name: cargo test
runs-on: macos-latest
env:
CARGO_TERM_COLOR: always
strategy:
fail-fast: false
matrix:
package:
[
gadget-networking,
gadget-executor,
gadget-utils-tangle,
]
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: install protobuf and gmp
run: |
brew install protobuf gmp
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: tests
run: cargo nextest run --profile serial --package ${{ matrix.package }}
# TODO: nextest doesn't support doc tests yet (https://github.com/nextest-rs/nextest/issues/16)
- name: doc tests
run: cargo test --package ${{ matrix.package }} --doc