Install Polkadot SDK #83
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: Install Polkadot SDK | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'polkadot-docs/parachains/install-polkadot-sdk/**' | |
| - '!polkadot-docs/parachains/install-polkadot-sdk/README.md' | |
| - 'versions.yml' | |
| pull_request: | |
| paths: | |
| - 'polkadot-docs/parachains/install-polkadot-sdk/**' | |
| - '!polkadot-docs/parachains/install-polkadot-sdk/README.md' | |
| - 'versions.yml' | |
| workflow_dispatch: | |
| jobs: | |
| guard: | |
| if: github.repository == 'polkadot-developers/polkadot-cookbook' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should-run: ${{ steps.check.outputs.should-run }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: check | |
| uses: ./.github/actions/check-version-keys | |
| with: | |
| event-name: ${{ github.event_name }} | |
| base-sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} | |
| head-sha: ${{ github.sha }} | |
| test: | |
| needs: guard | |
| if: needs.guard.outputs.should-run == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Load versions | |
| id: versions | |
| run: | | |
| echo "POLKADOT_SDK_VERSION=$(yq '.polkadot_sdk.release_tag' versions.yml)" >> $GITHUB_OUTPUT | |
| - name: Setup Rust | |
| run: | | |
| cd polkadot-docs/parachains/install-polkadot-sdk | |
| rustup show | |
| - name: Add wasm target and rust-src | |
| run: | | |
| rustup target add wasm32-unknown-unknown | |
| rustup component add rust-src | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler clang make | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Install npm dependencies | |
| run: | | |
| cd polkadot-docs/parachains/install-polkadot-sdk | |
| npm ci | |
| - name: Run tests | |
| run: | | |
| cd polkadot-docs/parachains/install-polkadot-sdk | |
| npm test | |
| timeout-minutes: 15 | |
| env: | |
| POLKADOT_SDK_VERSION: ${{ steps.versions.outputs.POLKADOT_SDK_VERSION }} | |
| post-test: | |
| needs: [guard, test] | |
| if: github.repository == 'polkadot-developers/polkadot-cookbook' && needs.guard.outputs.should-run == 'true' && always() && github.ref == 'refs/heads/master' | |
| uses: ./.github/workflows/post-cleanup.yml | |
| with: | |
| test_result: ${{ needs.test.result }} | |
| readme_path: 'polkadot-docs/parachains/install-polkadot-sdk/README.md' | |
| workflow_name: 'Install Polkadot SDK' | |
| permissions: | |
| contents: read | |
| issues: write |