Dockerize #873
Workflow file for this run
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: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| - 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: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| - 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: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| - 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 | |
| with: | |
| rust_version: "1.85" | |
| - 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 substrate-node for e2e test | |
| run: | | |
| wget https://github.com/paritytech/substrate-contracts-node/releases/download/v0.42.0/substrate-contracts-node-linux.tar.gz | |
| tar -xzf substrate-contracts-node-linux.tar.gz | |
| mv substrate-contracts-node-linux/substrate-contracts-node . | |
| chmod +x substrate-contracts-node | |
| rm -r substrate-contracts-node-linux | |
| rm substrate-contracts-node-linux.tar.gz | |
| echo "CONTRACTS_NODE=$GITHUB_WORKSPACE/substrate-contracts-node" >> $GITHUB_ENV | |
| - name: Verify substrate-contracts-node | |
| run: | | |
| echo "CONTRACTS_NODE is: $CONTRACTS_NODE" | |
| ls -la $CONTRACTS_NODE | |
| $CONTRACTS_NODE --version | |
| - 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 --locked | |
| - 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 |