Skip to content

Commit

Permalink
ci: relay_chain argument for baedeker
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Sep 5, 2023
1 parent 98753ec commit 56c4087
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .baedeker/xcm-opal.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
5 changes: 3 additions & 2 deletions .baedeker/xcm-quartz.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down Expand Up @@ -113,7 +115,6 @@ local shiden = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand Down
4 changes: 3 additions & 1 deletion .baedeker/xcm-unique.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
11 changes: 10 additions & 1 deletion .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 5 additions & 12 deletions .github/workflows/xcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand All @@ -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 }}'}})
Expand Down

0 comments on commit 56c4087

Please sign in to comment.