Add check runtimes GH Workflow (#2252)

This PR introduces:
- a new script 
- a new GH Workflow 
- runtime reference spec files for `rococo` and `westend`

It brings a mechanism to check that part(s) of the runtimes' metadata
that should not change over time, actually did not change over time.

Ideally, the GHW should trigger when a release is edited but GH seem to
[have an issue](https://github.com/orgs/community/discussions/47794)
that prevents the trigger from working. This is why the check has been
implemented as `workflow_dispatch` for a start.

The `workflow_dispatch` requires a `release_id` that can be found using:
```
curl -s -H "Authorization: Bearer ${GITHUB_TOKEN}" \
   https://api.github.com/repos/paritytech/polkadot-sdk/releases | \
   jq '.[] | { name: .name, id: .id }'
```
as documented in the workflow.

A sample run can be seen
[here](https://github.com/chevdor/polkadot-sdk/actions/runs/6811176342).
This commit is contained in:
Chevdor
2023-12-13 10:28:34 +01:00
committed by GitHub
parent 8683bbeefb
commit 3c5fcbe637
7 changed files with 262 additions and 5 deletions
+8 -3
View File
@@ -202,21 +202,26 @@ fetch_release_artifacts() {
echo "Release ID : $RELEASE_ID"
echo "Repo : $REPO"
echo "Binary : $BINARY"
OUTPUT_DIR=${OUTPUT_DIR:-"./release-artifacts/${BINARY}"}
echo "OUTPUT_DIR : $OUTPUT_DIR"
echo "Fetching release info..."
curl -L -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${REPO}/releases/${RELEASE_ID} > release.json
# Get Asset ids
echo "Extract asset ids..."
ids=($(jq -r '.assets[].id' < release.json ))
echo "Extract asset count..."
count=$(jq '.assets|length' < release.json )
# Fetch artifacts
mkdir -p "./release-artifacts/${BINARY}"
pushd "./release-artifacts/${BINARY}" > /dev/null
mkdir -p "$OUTPUT_DIR"
pushd "$OUTPUT_DIR" > /dev/null
echo "Fetching assets..."
iter=1
for id in "${ids[@]}"
do