Skip to content

Commit

Permalink
Merge branch 'master' into mak-1018-tests-misc
Browse files Browse the repository at this point in the history
  • Loading branch information
mordamax authored Aug 19, 2024
2 parents 98e9714 + 946afaa commit 1d66c84
Show file tree
Hide file tree
Showing 127 changed files with 2,729 additions and 1,212 deletions.
22 changes: 22 additions & 0 deletions .github/actions/cargo-check-runtimes/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'cargo check runtimes'
description: 'Runs `cargo check` for every directory in provided root.'
inputs:
root:
description: "Root directory. Expected to contain several cargo packages inside."
required: true
runs:
using: "composite"
steps:
- name: Check
shell: bash
run: |
mkdir -p ~/.forklift
cp .forklift/config.toml ~/.forklift/config.toml
cd ${{ inputs.root }}
for directory in $(echo */); do
echo "_____Running cargo check for ${directory} ______";
cd ${directory};
pwd;
SKIP_WASM_BUILD=1 forklift cargo check --locked;
cd ..;
done
136 changes: 136 additions & 0 deletions .github/workflows/check-cargo-check-runtimes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Check Cargo Check Runtimes

on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review, labeled ]


# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers

jobs:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
set-image:
if: contains(github.event.label.name, 'GHA-migration') || contains(github.event.pull_request.labels.*.name, 'GHA-migration')
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
check-runtime-assets:
runs-on: arc-runners-polkadot-sdk-beefy
needs: [set-image]
timeout-minutes: 20
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/assets

check-runtime-collectives:
runs-on: arc-runners-polkadot-sdk-beefy
needs: [check-runtime-assets, set-image]
timeout-minutes: 20
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/collectives

check-runtime-coretime:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-assets, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/coretime

check-runtime-bridge-hubs:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/bridge-hubs

check-runtime-contracts:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-collectives, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/contracts

check-runtime-starters:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-assets, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/starters

check-runtime-testing:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-starters, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/testing

confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All check-runtime-* tests passed
# If any new job gets added, be sure to add it to this array
needs:
- check-runtime-assets
- check-runtime-collectives
- check-runtime-coretime
- check-runtime-bridge-hubs
- check-runtime-contracts
- check-runtime-starters
- check-runtime-testing
steps:
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
3 changes: 3 additions & 0 deletions .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Take a snapshot at 5am when most SDK devs are not working.
schedule:
- cron: '0 5 * * *'
merge_group:
workflow_dispatch:

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/command-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,21 @@ concurrency:
cancel-in-progress: true

jobs:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
cmd-prdoc:
needs: [set-image]
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: ${{ needs.set-image.outputs.IMAGE }}
permissions:
contents: write
pull-requests: write
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ env:
# EVENT_ACTION: ${{ github.event.action }}
EVENT_NAME: ${{ github.event_name }}
IMAGE_TYPE: ${{ inputs.image_type }}
VERSION: ${{ inputs.version }}

jobs:
validate-inputs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.validate_inputs.outputs.VERSION }}
release_id: ${{ steps.validate_inputs.outputs.RELEASE_ID }}
stable_tag: ${{ steps.validate_inputs.outputs.stable_tag }}

steps:
Expand All @@ -93,17 +94,20 @@ jobs:
. ./.github/scripts/common/lib.sh
VERSION=$(filter_version_from_input "${{ inputs.version }}")
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
RELEASE_ID=$(check_release_id "${{ inputs.release_id }}")
echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV
echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_OUTPUT
echo "Release ID: $RELEASE_ID"
STABLE_TAG=$(validate_stable_tag ${{ inputs.stable_tag }})
echo "stable_tag=${STABLE_TAG}" >> $GITHUB_OUTPUT
fetch-artifacts: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
needs: [validate-inputs]

steps:
- name: Checkout sources
Expand All @@ -129,6 +133,7 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
VERSION="${{ needs.validate-inputs.outputs.VERSION }}"
fetch_release_artifacts_from_s3
- name: Fetch chain-spec-builder rc artifacts or release artifacts based on release id
Expand All @@ -137,6 +142,7 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
RELEASE_ID="${{ needs.validate-inputs.outputs.RELEASE_ID }}"
fetch_release_artifacts
- name: Upload artifacts
Expand Down Expand Up @@ -181,8 +187,7 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
RELEASE_ID=$(check_release_id "${{ inputs.release_id }}")
release=release-$RELEASE_ID && \
release="release-${{ needs.validate-inputs.outputs.RELEASE_ID }}" && \
echo "release=${release}" >> $GITHUB_OUTPUT
commit=$(git rev-parse --short HEAD) && \
Expand All @@ -198,9 +203,14 @@ jobs:
id: fetch_release_refs
run: |
chmod a+rx $BINARY
[[ $BINARY != 'chain-spec-builder' ]] && VERSION=$(./$BINARY --version | awk '{ print $2 }' )
release=$( echo $VERSION | cut -f1 -d- )
if [[ $BINARY != 'chain-spec-builder' ]]; then
VERSION=$(./$BINARY --version | awk '{ print $2 }' )
release=$( echo $VERSION | cut -f1 -d- )
else
release=$(echo ${{ needs.validate-inputs.outputs.VERSION }} | sed 's/^v//')
fi
echo "tag=latest" >> $GITHUB_OUTPUT
echo "release=${release}" >> $GITHUB_OUTPUT
echo "stable=${{ needs.validate-inputs.outputs.stable_tag }}" >> $GITHUB_OUTPUT
Expand Down
Loading

0 comments on commit 1d66c84

Please sign in to comment.