From 36c8fbe4917fbc643dc59e5deae6d806996e343e Mon Sep 17 00:00:00 2001 From: Alex Todorov Date: Thu, 20 Apr 2023 17:11:46 +0000 Subject: [PATCH] Use live sync for try-runtime-migrations test job b/c try-runtime snapshots format has changed and the older files are no longer viable. See https://github.com/paritytech/substrate/pull/12537 --- .github/workflows/runtime-upgrade.yml | 34 +++++++++++---------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/runtime-upgrade.yml b/.github/workflows/runtime-upgrade.yml index 3078239f8d..81cd289fd1 100644 --- a/.github/workflows/runtime-upgrade.yml +++ b/.github/workflows/runtime-upgrade.yml @@ -314,11 +314,7 @@ jobs: LC_GITHUB_REPO_ADMIN_TOKEN: ${{ secrets.GH_REPO_ADMIN_TOKEN }} LC_RUNNER_EPHEMERAL: false - test-migrations: - env: - SNAPSHOT_TIME: 12-19-22 - SNAPSHOT_DIR: /var/tmp/blockchain-snapshot - SNAPSHOT_URL: "https://creditcoinblockchain.blob.core.windows.net/latestblocks/creditcoin-2.0-$GITHUB_BASE_REF-try-runtime-snapshot-$SNAPSHOT_TIME.tar.gz" + test-migrations-via-try-runtime: # see https://gist.github.com/jonico/a94d03cac7a858e0613926d9f1bc7f2b runs-on: [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] @@ -348,33 +344,31 @@ jobs: run: | ./scripts/check-hardware.sh - - name: Download try-runtime snapshots data for Creditcoin + - name: Testnet ENV + id: testnet-env + if: github.base_ref == 'testnet' run: | - echo "INFO: SNAPSHOT_URL=${{ env.SNAPSHOT_URL }}" - echo "INFO: SNAPSHOT_DIR=${{ env.SNAPSHOT_DIR }}" - - curl --silent ${{ env.SNAPSHOT_URL }} > snapshot.tar.gz - - mkdir ${{ env.SNAPSHOT_DIR }} - tar -xzvf ./snapshot.tar.gz -C ${{ env.SNAPSHOT_DIR }} + echo "rpc_url=wss://rpc.testnet.creditcoin.network:443/ws" >> "$GITHUB_OUTPUT" - # standardize file names - pushd ${{ env.SNAPSHOT_DIR }} - mv creditcoin-*.child creditcoin.child - mv creditcoin-*.top creditcoin.top - popd + - name: Mainnet ENV + id: mainnet-env + if: github.base_ref == 'main' + run: | + echo "rpc_url=wss://rpc.mainnet.creditcoin.network:443/ws" >> "$GITHUB_OUTPUT" - name: Try-runtime migrations run: | ./target/release/creditcoin-node try-runtime \ --runtime ./target/release/creditcoin_node_runtime.compact.compressed.wasm \ - --dev on-runtime-upgrade snap --snapshot-path ${{ env.SNAPSHOT_DIR }}/creditcoin. + --dev on-runtime-upgrade live --uri ${{ env.RPC_URL }} + env: + RPC_URL: ${{ steps.testnet-env.outputs.rpc_url || steps.mainnet-env.outputs.rpc_url }} remove-github-runner: runs-on: ubuntu-22.04 needs: - deploy-github-runner - - test-migrations + - test-migrations-via-try-runtime - execute-integration-tests if: ${{ always() && needs.deploy-github-runner.result != 'skipped' }}