Skip to content

Commit

Permalink
[no ci]Use dasel for editing toml file
Browse files Browse the repository at this point in the history
Signed-off-by: Dengjianping <djptux@gmail.com>
  • Loading branch information
Dengjianping committed Aug 4, 2023
1 parent 0bf6610 commit c700054
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/metadata_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ jobs:
run: sccache --stop-server || true
- name: Install pm2
run: npm install -g pm2
- name: Install toml cli
- name: Install dasel cli
run: |
cargo install toml-cli
toml --version
curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o dasel && chmod +x dasel
mv ./dasel $HOME/.cargo/bin/dasel
dasel --version
- uses: actions/checkout@v2
with:
repository: paritytech/zombienet
Expand All @@ -126,18 +127,21 @@ jobs:
run: |
ls -ahl ${{ github.workspace }}/zombienet/tests
cd ${{ github.workspace }}
toml set ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \
relaychain.default_command $HOME/polkadot > ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp1.toml
toml set ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp1.toml \
parachains[0].collators[0].command $HOME/manta > ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp2.toml
dasel put -t string -v $HOME/polkadot -r toml \
-f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \
'.relaychain.default_command'
dasel put -t string -v $HOME/manta -r toml \
-f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \
'.parachains.[0].collators.[0].command'
if [[ "$CHAIN" == *"manta"* ]]; then
toml set ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp2.toml \
parachains[0].id 2104 > ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp3.toml
toml set ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp3.toml \
parachains[0].chain $CHAIN > ${{ github.workspace }}/zombienet/tests/diff-metadata.toml
else
cp ${{ github.workspace }}/zombienet/tests/metadata-diff-tmp2.toml ${{ github.workspace }}/zombienet/tests/diff-metadata.toml
dasel put -t int -v 2104 -r toml \
-f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \
'.parachains.[0].id'
dasel put -t string -v $CHAIN -r toml \
-f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \
'.parachains.[0].chain'
fi;
cat ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml
- name: launch testnet
run: |
cd ${{ github.workspace }}/zombienet-tool/javascript
Expand All @@ -146,7 +150,7 @@ jobs:
pm2 start packages/cli/dist/cli.js --name zombienet \
--output ${{ github.workspace }}/stdout.log \
--error ${{ github.workspace }}/stderr.log \
-- spawn --provider native ${{ github.workspace }}/zombienet/tests/diff-metadata.toml
-- spawn --provider native ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml
- name: Prepare output
run: |
VERSION=$($HOME/manta --version)
Expand Down

0 comments on commit c700054

Please sign in to comment.