From d7c66d9766f633abab95127ee910dd96892f8e3b Mon Sep 17 00:00:00 2001 From: Chevdor Date: Mon, 30 Oct 2023 16:41:55 +0100 Subject: [PATCH] Add debugging info and fixes for the monorepo (#25) * Add debugging info * Remove default value * Fix endgroup * Fix workdir issue * Switch test to the SDK repo * Add runtime_dir --- .github/workflows/cumulus.yml | 72 ------------------- .../{polkadot.yml => polkadot-sdk.yml} | 19 +++-- .gitignore | 1 + action.yml | 21 +++--- 4 files changed, 25 insertions(+), 88 deletions(-) delete mode 100644 .github/workflows/cumulus.yml rename .github/workflows/{polkadot.yml => polkadot-sdk.yml} (79%) diff --git a/.github/workflows/cumulus.yml b/.github/workflows/cumulus.yml deleted file mode 100644 index a3a82d3..0000000 --- a/.github/workflows/cumulus.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Build Cumulus Repo - -env: - DEFAULT_IMAGE: paritytech/srtool - -on: - pull_request: - types: [opened, reopened, synchronize] - - push: - tags: - - "v*" - branches: - - master - - workflow_dispatch: - inputs: - srtool_image: - description: The SRTOOL image to use - default: paritytech/srtool - required: false - srtool_tag: - description: The SRTOOL tag to use - default: 1.70.0 - required: false - - schedule: - - cron: "00 04 * * 1" # 4AM weekly on mondays - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - category: contracts - runtime: contracts-rococo - - category: assets - runtime: asset-hub-kusama - - category: assets - runtime: asset-hub-polkadot - - category: starters - runtime: shell - name: Build ${{ matrix.category }}/${{ matrix.runtime }} - steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - with: - path: action - - - name: Checkout repo under test - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - with: - repository: paritytech/cumulus - fetch-depth: 0 - path: repo - - - name: Srtool build - id: srtool_build - uses: ./action - with: - image: ${{ github.event.inputs.srtool_image || env.DEFAULT_IMAGE }} - tag: ${{ github.event.inputs.srtool_tag }} - chain: ${{ matrix.runtime }} - runtime_dir: parachains/runtimes/${{ matrix.category }}/${{ matrix.runtime }} - workdir: "${{ github.workspace }}/repo" - - - name: Summary - run: | - echo '${{ steps.srtool_build.outputs.json }}' | jq . | tee ${{ matrix.runtime }}-srtool-digest.json - echo "Compact Runtime location : ${{ steps.srtool_build.outputs.wasm }}" - echo "Compressed Runtime location : ${{ steps.srtool_build.outputs.wasm_compressed }}" diff --git a/.github/workflows/polkadot.yml b/.github/workflows/polkadot-sdk.yml similarity index 79% rename from .github/workflows/polkadot.yml rename to .github/workflows/polkadot-sdk.yml index 2fcf4f5..358335c 100644 --- a/.github/workflows/polkadot.yml +++ b/.github/workflows/polkadot-sdk.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - chain: ["polkadot", "kusama", "westend"] + chain: ["westend", "rococo"] name: Build ${{ matrix.chain }} steps: @@ -44,19 +44,26 @@ jobs: - name: Checkout repo under test uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: - repository: paritytech/polkadot + repository: paritytech/polkadot-sdk fetch-depth: 0 - path: repo + path: sdk - - name: Srtool build + - name: Debug + run: | + ls -al + ls -al sdk + ls -al sdk/polkadot/runtime/${{ matrix.chain }} + + - name: Srtool build for ${{ matrix.chain }} id: srtool_build uses: ./action with: image: ${{ github.event.inputs.srtool_image || env.DEFAULT_IMAGE }} tag: ${{ github.event.inputs.srtool_tag }} chain: ${{ matrix.chain }} - workdir: "${{ github.workspace }}/repo" - profile: "production" + workdir: sdk + runtime_dir: polkadot/runtime/${{ matrix.chain }} + profile: production - name: Summary run: | diff --git a/.gitignore b/.gitignore index a9b6459..b97f4f8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ polkadot _actions workflow +.vscode diff --git a/action.yml b/action.yml index bed9fdc..d19f145 100644 --- a/action.yml +++ b/action.yml @@ -105,16 +105,16 @@ runs: echo "RUSTC_VERSION=$RUSTC_VERSION" echo "SRTOOL_VERSION=$SRTOOL_VERSION" echo "SRTOOL_LATEST=$RUSTC_VERSION" - echo ::endgroup + echo ::endgroup:: echo ::group::Environment setup SRTOOL_TAG=${{ inputs.tag || env.SRTOOL_LATEST }} echo "SRTOOL_TAG=$SRTOOL_TAG" >> $GITHUB_ENV echo "SRTOOL_IMAGE=${{ inputs.image }}:$SRTOOL_TAG" >> $GITHUB_ENV - echo "WORKDIR=${{ inputs.workdir || github.workspace }}" >> $GITHUB_ENV + echo "WORKDIR=${{ github.workspace }}/${{ inputs.workdir }}" >> $GITHUB_ENV - RUNTIME_DIR=${{ inputs.runtime_dir}} - RUNTIME_DIR=${RUNTIME_DIR:-'runtime/'${{ inputs.chain}}} + RUNTIME_DIR=${{ inputs.runtime_dir }} + RUNTIME_DIR=${RUNTIME_DIR:-'runtime/'${{ inputs.chain }}} echo "RUNTIME_DIR=$RUNTIME_DIR" >> $GITHUB_ENV PACKAGE=${{ inputs.package }} @@ -133,7 +133,7 @@ runs: echo "PARACHAIN_PALLET_ID=$PARACHAIN_PALLET_ID" >> $GITHUB_ENV echo "AUTHORIZE_UPGRADE_PREFIX=$AUTHORIZE_UPGRADE_PREFIX" >> $GITHUB_ENV - echo ::endgroup + echo ::endgroup:: - id: env_check name: Checking Env @@ -145,6 +145,7 @@ runs: echo ℹ️ image: ${{ env.SRTOOL_IMAGE }} echo ℹ️ chain: ${{ inputs.chain }} echo ℹ️ package: ${{ env.PACKAGE }} + echo ℹ️ Github Workspace: ${{ github.workspace }} echo ℹ️ workdir: ${{ env.WORKDIR }} echo ℹ️ runtime_dir: ${{ env.RUNTIME_DIR }} echo ℹ️ build_opts: ${{ env.BUILD_OPTS }} @@ -154,7 +155,7 @@ runs: echo ℹ️ .git folder: `ls -ald ${{ env.WORKDIR }}/.git` echo ℹ️ Cargo.toml: `ls -al ${{ env.WORKDIR }}/Cargo.toml` - echo ::endgroup + echo ::endgroup:: - id: pulling_srtool name: Build ${{ env.PACKAGE }} using ${{ env.SRTOOL_IMAGE }} @@ -162,7 +163,7 @@ runs: run: | echo ::group::Pulling the srtool docker image: ${{ env.SRTOOL_IMAGE }} docker pull ${{ env.SRTOOL_IMAGE }} - echo ::endgroup + echo ::endgroup:: - id: version shell: bash @@ -172,7 +173,7 @@ runs: JSON=`$CMD` echo $JSON | jq . echo "version=$JSON" >> $GITHUB_OUTPUT - echo ::endgroup + echo ::endgroup:: - id: info shell: bash @@ -182,7 +183,7 @@ runs: JSON=`$CMD` echo $JSON | jq . echo "info=$JSON" >> $GITHUB_OUTPUT - echo ::endgroup + echo ::endgroup:: - id: build name: Build ${{ env.PACKAGE }} using ${{ env.SRTOOL_IMAGE }} @@ -215,4 +216,4 @@ runs: IPFS=`echo $JSON | jq -r .runtimes.compact.ipfs` echo "ipfs=$IPFS" >> $GITHUB_OUTPUT } - echo ::endgroup + echo ::endgroup::