From 56c4087ab1ae871d4dc975938700824be0c5decb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sun, 3 Sep 2023 18:22:14 +0200 Subject: [PATCH] ci: relay_chain argument for baedeker --- .baedeker/xcm-opal.jsonnet | 4 +++- .baedeker/xcm-quartz.jsonnet | 5 +++-- .baedeker/xcm-unique.jsonnet | 4 +++- .github/actions/prepare/action.yml | 11 ++++++++++- .github/workflows/xcm.yml | 17 +++++------------ 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.baedeker/xcm-opal.jsonnet b/.baedeker/xcm-opal.jsonnet index d767ec899b..c203797263 100644 --- a/.baedeker/xcm-opal.jsonnet +++ b/.baedeker/xcm-opal.jsonnet @@ -2,12 +2,14 @@ local m = import 'baedeker-library/mixin/spec.libsonnet', ; +function(relay_spec) + local relay = { name: 'relay', bin: 'bin/polkadot', validatorIdAssignment: 'staking', spec: {Genesis:{ - chain: 'westend-local', + chain: relay_spec, modify:: m.genericRelay($, hrmp = [ [$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512], [$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512], diff --git a/.baedeker/xcm-quartz.jsonnet b/.baedeker/xcm-quartz.jsonnet index 62c677e659..8e0060dcaf 100644 --- a/.baedeker/xcm-quartz.jsonnet +++ b/.baedeker/xcm-quartz.jsonnet @@ -2,12 +2,14 @@ local m = import 'baedeker-library/mixin/spec.libsonnet', ; +function(relay_spec) + local relay = { name: 'relay', bin: 'bin/polkadot', validatorIdAssignment: 'staking', spec: {Genesis:{ - chain: 'westend-local', + chain: relay_spec, modify:: m.genericRelay($, hrmp = std.join([], [ [[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]], for [a, b] in [ @@ -113,7 +115,6 @@ local shiden = { [name]: { bin: $.bin, wantedKeys: 'para', - legacyRpc: true, }, for name in ['alice', 'bob'] }, diff --git a/.baedeker/xcm-unique.jsonnet b/.baedeker/xcm-unique.jsonnet index 2dc668000d..42a877d944 100644 --- a/.baedeker/xcm-unique.jsonnet +++ b/.baedeker/xcm-unique.jsonnet @@ -2,12 +2,14 @@ local m = import 'baedeker-library/mixin/spec.libsonnet', ; +function(relay_spec) + local relay = { name: 'relay', bin: 'bin/polkadot', validatorIdAssignment: 'staking', spec: {Genesis:{ - chain: 'westend-local', + chain: relay_spec, modify:: m.genericRelay($, hrmp = std.join([], [ [[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]], for [a, b] in [ diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index e91384a0ba..6c4e817950 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -14,7 +14,16 @@ runs: shell: bash run: | echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV} - - name: Set build SHA + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@4 + id: ref_slug + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + - name: Set BUILD_SHA, REF_SLUG shell: bash run: | echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + echo "REF_SLUG=${{ steps.ref_slug.outputs.value }}" >> $GITHUB_ENV + diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 5f6a54a765..4bf391d992 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -284,25 +284,16 @@ jobs: fi shell: bash - - - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@4 - id: branchname - with: - source: ${{ github.head_ref }} - find: '/' - replace: '-' - - name: Build unique-chain run: | docker build --file .docker/Dockerfile-unique \ --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \ --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \ - --tag uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }} \ + --tag uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} \ . - name: Push docker image version - run: docker push uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }} + run: docker push uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} - uses: actions/setup-node@v3.5.1 with: @@ -320,10 +311,12 @@ jobs: with: jpath: | .baedeker/vendor + tla-str: | + relay_spec=rococo inputs: | .baedeker/xcm-${{ matrix.network }}.jsonnet snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}'}}) - snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/acala':{dockerImage:'uniquenetwork/builder-acala:${{ matrix.acala_version }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/moonbeam':{dockerImage:'uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/cumulus':{dockerImage:'uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}'}})