-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into gonza/foreign-asset…
…s-via-token-lock
- Loading branch information
Showing
103 changed files
with
7,518 additions
and
9,603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build Production Binary | ||
description: | | ||
Builds production a moonbeam binary for a given CPU target | ||
inputs: | ||
target: | ||
description: The CPU target for the binary | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build production moonbeam | ||
shell: bash | ||
run: | | ||
# Build moonbeam | ||
# (we don't use volumes because of ownership/permissions issues) | ||
docker build \ | ||
--tag prod --no-cache \ | ||
--build-arg="COMMIT=${{ github.event.inputs.sha }}" \ | ||
--build-arg="RUSTFLAGS=-C target-cpu=${{ inputs.target }}" \ | ||
- < docker/moonbeam-production.Dockerfile | ||
# Copy moonbeam binary | ||
docker rm -f dummy 2> /dev/null | true | ||
docker create -ti --name dummy prod bash | ||
docker cp dummy:/moonbeam/moonbeam moonbeam | ||
docker rm -f dummy | ||
GLIBC_VERSION="$(objdump -T moonbeam | grep "GLIBC_" | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu | tail -1)" | ||
if [[ $GLIBC_VERSION == "2.34" ]]; then | ||
echo "✅ Using expected GLIBC version: ${GLIBC_VERSION}"; | ||
else | ||
echo "❌ Unexpected GLIBC version: ${GLIBC_VERSION}"; | ||
exit 1; | ||
fi | ||
# Cleanup | ||
docker rmi prod | ||
- name: Save parachain binary | ||
shell: bash | ||
run: | | ||
mkdir -p build | ||
cp moonbeam build/moonbeam-${{ inputs.target }} | ||
- name: Upload binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries-${{inputs.target}} | ||
path: build/moonbeam-${{inputs.target}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Publish docker image | ||
description: | | ||
Publish docker image tags to dockerhub | ||
inputs: | ||
dockerhub_username: | ||
description: "Dockerhub username" | ||
required: true | ||
dockerhub_password: | ||
description: "Dockerhub password" | ||
required: true | ||
image_tags: | ||
description: "Image tags" | ||
required: true | ||
image_title: | ||
description: "Image title" | ||
required: true | ||
image_description: | ||
description: "Image description" | ||
required: true | ||
image_url: | ||
description: "Image url" | ||
required: true | ||
image_source: | ||
description: "Image source" | ||
required: true | ||
image_created: | ||
description: "Image creation timestamp" | ||
required: true | ||
image_revision: | ||
description: "Image revision" | ||
required: true | ||
image_licenses: | ||
description: "Image licenses" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
version: latest | ||
driver-opts: | | ||
image=moby/buildkit:master | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ inputs.dockerhub_username }} | ||
password: ${{ inputs.dockerhub_password }} | ||
- name: Build and push moonbeam | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./docker/moonbeam.Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ inputs.image_tags }} | ||
labels: | | ||
org.opencontainers.image.title=${{ inputs.image_title }} | ||
org.opencontainers.image.description=${{ inputs.image_title }} | ||
org.opencontainers.image.url=${{ inputs.image_url }} | ||
org.opencontainers.image.source=${{ inputs.image_source }} | ||
org.opencontainers.image.created=${{ inputs.image_created }} | ||
org.opencontainers.image.revision=${{ inputs.image_revision }} | ||
org.opencontainers.image.licenses=${{ inputs.image_licenses }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,7 @@ jobs: | |
name: "Check WASM runtimes with Twiggy" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
pull-requests: write | ||
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }} | ||
|
@@ -317,14 +318,27 @@ jobs: | |
- name: Download Twiggy | ||
run: cargo install twiggy | ||
- name: Lookup for latest target branch build | ||
id: latest-target-build | ||
run: | | ||
TARGET_BRANCH=${{ github.event.pull_request.base.ref }} | ||
LATEST_TARGET_BRANCH_BUILD=$(gh run -R moonbeam-foundation/moonbeam list -w Build --limit=100 --json databaseId,url,headBranch,event,status,conclusion,createdAt --jq ".[] | select(.headBranch == \"$TARGET_BRANCH\" and .event == \"push\" and .status == \"completed\" and .conclusion == \"success\") | .databaseId" | head -n 1) | ||
echo "LATEST_TARGET_BRANCH_BUILD=$LATEST_TARGET_BRANCH_BUILD" >> $GITHUB_OUTPUT | ||
- name: Download latest target branch build artifacts | ||
run: | | ||
gh run download $LATEST_TARGET_BRANCH_BUILD -n uncompressed-runtimes --dir uncompressed-runtimes-target-branch | ||
gh run download $LATEST_TARGET_BRANCH_BUILD -n runtimes --dir runtimes-target-branch | ||
- name: "Download runtimes from target branch" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: runtimes | ||
path: runtimes-target-branch | ||
merge-multiple: true | ||
github-token: ${{ github.token }} | ||
run-id: ${{ steps.latest-target-build.outputs.LATEST_TARGET_BRANCH_BUILD }} | ||
- name: "Download uncompressed-runtimes from target branch" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: uncompressed-runtimes | ||
path: uncompressed-runtimes-target-branch | ||
merge-multiple: true | ||
github-token: ${{ github.token }} | ||
run-id: ${{ steps.latest-target-build.outputs.LATEST_TARGET_BRANCH_BUILD }} | ||
- name: Check Runtimes size for target branch | ||
run: | | ||
PREVIOUS_MOONBASE=$(du -k runtimes-target-branch/* | awk '/moonbase_runtime/ {print $1}') | ||
|
@@ -338,11 +352,13 @@ jobs: | |
with: | ||
name: runtimes | ||
path: runtimes-current-branch | ||
merge-multiple: true | ||
- name: "Download branch built uncompressed-runtimes" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: uncompressed-runtimes | ||
path: uncompressed-runtimes-current-branch | ||
merge-multiple: true | ||
- name: Check Runtimes size for current branch | ||
run: | | ||
CURRENT_MOONBASE=$(du -k runtimes-current-branch/* | awk '/moonbase_runtime/ {print $1}') | ||
|
@@ -470,6 +486,7 @@ jobs: | |
RUSTC_WRAPPER: "sccache" | ||
CARGO_INCREMENTAL: "0" | ||
SCCACHE_CACHE_SIZE: "100GB" | ||
SCCACHE_GHA_ENABLED: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -662,59 +679,6 @@ jobs: | |
pnpm compile-solidity | ||
pnpm moonwall test dev_moonbase_tracing | ||
docker-moonbeam: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
needs: ["set-tags", "build"] | ||
if: ${{ needs.set-tags.outputs.image_exists == 'false' && !github.event.pull_request.head.repo.fork }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.set-tags.outputs.git_ref }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: moonbeam | ||
path: build | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=moonbeamfoundation/moonbeam | ||
TAGS="${DOCKER_IMAGE}:sha-${{ needs.set-tags.outputs.sha8 }}" | ||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT | ||
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
version: latest | ||
driver-opts: | | ||
image=moby/buildkit:master | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }} | ||
- name: Build and push moonbeam | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./docker/moonbeam.Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.tags }} | ||
labels: | | ||
org.opencontainers.image.title=${{ github.event.repository.name }} | ||
org.opencontainers.image.description=${{ github.event.repository.description }} | ||
org.opencontainers.image.url=${{ github.event.repository.html_url }} | ||
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | ||
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} | ||
lazy-loading-tests: | ||
runs-on: | ||
labels: bare-metal | ||
|
@@ -863,13 +827,9 @@ jobs: | |
path: target/release | ||
- name: Retrieve moonbeam binary from docker (for plainSpec generation) | ||
run: | | ||
MOONBEAM_COMMIT=${{ needs.set-tags.outputs.latest_rt_sha8 }} | ||
DOCKER_TAG="moonbeamfoundation/moonbeam:sha-$MOONBEAM_COMMIT" | ||
docker rm -f moonbeam_container 2> /dev/null | true | ||
docker create --name moonbeam_container $DOCKER_TAG bash | ||
docker cp moonbeam_container:moonbeam/moonbeam test/tmp/moonbeam_rt | ||
docker rm -f moonbeam_container | ||
LATEST_CLIENT=$(curl -s https://api.github.com/repos/moonbeam-foundation/moonbeam/releases | jq -r '.[] | select(.name | test("v";"i")) | .tag_name' | sort -rs | head -n 1 | tr -d '[:blank:]') | ||
echo "Latest client: $LATEST_CLIENT" | ||
wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$LATEST_CLIENT/moonbeam -O test/tmp/moonbeam_rt | ||
- name: Prepare Chainspecs | ||
run: | | ||
cd test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.