Feat/pfg security #829
This file contains hidden or 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: Rust | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Run fmt | |
| run: | | |
| rustup component add rustfmt --toolchain nightly | |
| cargo +nightly fmt -- --check | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features --exclude idn-sdk-kitchensink-runtime --exclude idn-sdk-kitchensink-node --exclude idn-consumer-runtime --exclude idn-consumer-node --exclude idn-runtime --exclude idn-node --workspace -- -D warnings | |
| - name: Run cargo doc | |
| run: cargo doc --no-deps --all-features --exclude idn-sdk-kitchensink-runtime --exclude idn-sdk-kitchensink-node --exclude idn-consumer-runtime --exclude idn-consumer-node --exclude idn-runtime --exclude idn-node --workspace | |
| - name: Build | |
| run: cargo build --all-features --verbose --exclude idn-sdk-kitchensink-runtime --exclude idn-sdk-kitchensink-node --exclude idn-consumer-runtime --exclude idn-consumer-node --exclude idn-runtime --exclude idn-node --workspace | |
| build_idn_kitchen_sink: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features -p idn-sdk-kitchensink-node -- -D warnings | |
| - name: Run cargo doc for chains | |
| run: cargo doc --no-deps --all-features -p idn-sdk-kitchensink-node | |
| - name: Build | |
| run: cargo build --all-features --verbose -p idn-sdk-kitchensink-node | |
| build_idn_consumer: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features -p idn-consumer-node -- -D warnings | |
| - name: Run cargo doc for chains | |
| run: cargo doc --no-deps --all-features -p idn-consumer-node | |
| - name: Build | |
| run: cargo build --all-features -p idn-consumer-node --release | |
| build_idn: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features -p idn-node -- -D warnings | |
| - name: Run cargo doc for chains | |
| run: cargo doc --no-deps --all-features -p idn-node | |
| - name: Build | |
| run: cargo build --verbose --all-features -p idn-node --release | |
| consumer_contract: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features --manifest-path ./contracts/examples/consumer-contract/Cargo.toml -- -D warnings | |
| - name: Run fmt | |
| run: | | |
| rustup component add rustfmt --toolchain nightly | |
| cargo +nightly fmt --manifest-path ./contracts/examples/consumer-contract/Cargo.toml -- --check | |
| - name: Run cargo doc for the contract | |
| run: cargo doc --no-deps --manifest-path ./contracts/examples/consumer-contract/Cargo.toml | |
| - name: Install wasm32-unknown-unknown target | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Install substrate-node for e2e test | |
| run: cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git | |
| - name: Run Tests | |
| run: cargo test --manifest-path ./contracts/examples/consumer-contract/Cargo.toml --all-features | |
| - name: Install cargo-contract | |
| run: cargo install cargo-contract@5.0.3 | |
| - name: Build | |
| run: cargo contract build --manifest-path ./contracts/examples/consumer-contract/Cargo.toml --release | |
| randomness_contract: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features --manifest-path ./contracts/examples/rand-extension/Cargo.toml -- -D warnings | |
| - name: Run fmt | |
| run: | | |
| rustup component add rustfmt --toolchain nightly | |
| cargo +nightly fmt --manifest-path ./contracts/examples/rand-extension/Cargo.toml -- --check | |
| - name: Run cargo doc for the contract | |
| run: cargo doc --no-deps --all-features --manifest-path ./contracts/examples/rand-extension/Cargo.toml | |
| - name: Run Tests | |
| run: cargo test --manifest-path ./contracts/examples/rand-extension/Cargo.toml --all-features | |
| - name: Install cargo-contract | |
| run: cargo install cargo-contract@5.0.3 | |
| - name: Build | |
| run: cargo contract build --manifest-path ./contracts/examples/rand-extension/Cargo.toml --release | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-rust | |
| - name: Install llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Run Tests | |
| run: | | |
| cargo +nightly llvm-cov --exclude idn-sdk-kitchensink-runtime --exclude idn-sdk-kitchensink-node --exclude idn-consumer-runtime --exclude idn-consumer-node --exclude idn-runtime --exclude idn-node --workspace --all-features --doctests \ | |
| --cobertura --output-path cobertura.xml \ | |
| --ignore-filename-regex "(kitchensink|idn-consumer-(node|runtime)|ideal-network|benchmarking|weights|mock)" | |
| - name: Generate Code Coverage Summary | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: cobertura.xml | |
| badge: true | |
| fail_below_min: true | |
| thresholds: '85 90' | |
| output: both | |
| format: markdown | |
| - name: Export Job Summary | |
| run: echo "$(<code-coverage-results.md)" >> $GITHUB_STEP_SUMMARY |