Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: 💚 Reduce self-hosted runner usage #869

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0a088dd
ci: :green_heart: Reduce reliance on self-hosted runners
timbrinded Feb 11, 2025
319e3eb
Merge branch 'master' of github.com:moondance-labs/tanssi into ci/dis…
timbrinded Feb 11, 2025
9edd812
fix clippy
timbrinded Feb 11, 2025
329e68e
🪓 AFUERA
timbrinded Feb 11, 2025
27fb8ea
fix rust test
timbrinded Feb 11, 2025
c1a181c
change clippy back
timbrinded Feb 11, 2025
c497e56
Merge branch 'master' of github.com:moondance-labs/tanssi into ci/dis…
timbrinded Feb 11, 2025
61d4c87
switch to nextest
timbrinded Feb 12, 2025
5d64d10
switch back bare-metal 😢
timbrinded Feb 12, 2025
7177751
nextest sharding
timbrinded Feb 13, 2025
d526ed7
ci: 💚 fix nextest
timbrinded Feb 13, 2025
147b553
fix mold
timbrinded Feb 13, 2025
04c574c
revert format
timbrinded Feb 13, 2025
5cd4a08
fix mold
timbrinded Feb 13, 2025
a64d070
fix nextest
timbrinded Feb 13, 2025
f9365e5
fix test runner
timbrinded Feb 13, 2025
191037a
download artefacts
timbrinded Feb 13, 2025
2798e14
Merge branch 'master' of github.com:moondance-labs/tanssi into ci/dis…
timbrinded Feb 13, 2025
57266ad
reset formatting
timbrinded Feb 13, 2025
cf51583
fix test
timbrinded Feb 13, 2025
e4088a8
fix rust test
timbrinded Feb 13, 2025
338ffd1
update nextest
timbrinded Feb 13, 2025
38cae65
fix
timbrinded Feb 13, 2025
44e443c
ci fix
timbrinded Feb 13, 2025
1632306
ci fix
timbrinded Feb 13, 2025
356f6e9
CI FIX
timbrinded Feb 14, 2025
050fec8
ci fix
timbrinded Feb 14, 2025
8bb3af6
ci fix
timbrinded Feb 14, 2025
82661ce
rust-test ubuntu
timbrinded Feb 14, 2025
842cbb0
ci fix
timbrinded Feb 14, 2025
69cd093
use hosted
timbrinded Feb 14, 2025
1fd73ee
fix runners
timbrinded Feb 14, 2025
500bd47
fix runners
timbrinded Feb 14, 2025
4efaa47
rename ci
timbrinded Feb 14, 2025
62dcc7b
remove sharding
timbrinded Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflow-templates/bridge-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ runs:
id: setup_g_plusplus
run: |
g++ --version
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Check protoc
shell: bash
id: check_proto_c
Expand Down
206 changes: 103 additions & 103 deletions .github/workflows/docker-runtime-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,109 @@ name: Push Runtime Draft Docker

# The code compile in non-fast mode the runtime and pushes to docker
on:
push:
branches:
- perm-runtime-*
push:
branches:
- perm-runtime-*

jobs:
####### Building binaries #######
setup-scripts:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Upload tools
uses: actions/upload-artifact@v4
with:
name: original-tools
path: tools
####### Building binaries #######
setup-scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Upload tools
uses: actions/upload-artifact@v4
with:
name: original-tools
path: tools

build-binary:
needs: ["setup-scripts"]
runs-on: self-hosted
strategy:
matrix:
cpu: ["", "skylake", "znver3"]
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.cpu }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.to }}
- name: Setup Rust toolchain
run: rustup show
- name: Build Node
run: cargo build --profile=production --all
- name: Save parachain binary
if: ${{ matrix.cpu == '' }}
run: |
mkdir -p binaries
cp target/production/tanssi-node binaries/tanssi-node
cp target/production/container-chain-frontier-node binaries/container-chain-frontier-node
cp target/production/container-chain-simple-node binaries/container-chain-simple-node
- name: Save parachain custom binary
if: ${{ matrix.cpu != '' }}
run: |
mkdir -p binaries
cp target/production/tanssi-node binaries/tanssi-node-${{matrix.cpu}}
cp target/production/container-chain-frontier-node binaries/container-chain-frontier-node-${{matrix.cpu}}
cp target/production/container-chain-simple-node binaries/container-chain-simple-node-${{matrix.cpu}}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.chain.cpu }}
path: binaries
docker-tanssi:
runs-on: ubuntu-latest
needs: ["build-binary"]
strategy:
fail-fast: false
matrix:
image: ["tanssi", "container-chain-simple-template", "container-chain-evm-template"]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: binaries-${{ matrix.chain.cpu }}
merge-multiple: true
path: build
- name: Prepare
id: prep
run: |
SHA8=$(git log -1 --format='%H' | cut -c1-8)
DOCKER_IMAGE=moondancelabs/${{matrix.image}}
TAGS="${DOCKER_IMAGE}:sha-${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/setup-buildx-action@v3
with:
version: latest
driver-opts: |
image=moby/buildkit:master
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/${{matrix.image}}.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 }}
build-binary:
needs: ["setup-scripts"]
runs-on: self-hosted
strategy:
matrix:
cpu: ["", "skylake", "znver3"]
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.cpu }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.to }}
- name: Setup Rust toolchain
run: rustup show
- name: Build Node
run: cargo build --profile=production --all

- name: Save parachain binary
if: ${{ matrix.cpu == '' }}
run: |
mkdir -p binaries
cp target/production/tanssi-node binaries/tanssi-node
cp target/production/container-chain-frontier-node binaries/container-chain-frontier-node
cp target/production/container-chain-simple-node binaries/container-chain-simple-node
- name: Save parachain custom binary
if: ${{ matrix.cpu != '' }}
run: |
mkdir -p binaries
cp target/production/tanssi-node binaries/tanssi-node-${{matrix.cpu}}
cp target/production/container-chain-frontier-node binaries/container-chain-frontier-node-${{matrix.cpu}}
cp target/production/container-chain-simple-node binaries/container-chain-simple-node-${{matrix.cpu}}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.chain.cpu }}
path: binaries
docker-tanssi:
runs-on: ubuntu-latest
needs: ["build-binary"]
strategy:
fail-fast: false
matrix:
image: ["tanssi", "container-chain-simple-template", "container-chain-evm-template"]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: binaries-${{ matrix.chain.cpu }}
merge-multiple: true
path: build
- name: Prepare
id: prep
run: |
SHA8=$(git log -1 --format='%H' | cut -c1-8)
DOCKER_IMAGE=moondancelabs/${{matrix.image}}
TAGS="${DOCKER_IMAGE}:sha-${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/setup-buildx-action@v3
with:
version: latest
driver-opts: |
image=moby/buildkit:master
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/${{matrix.image}}.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 }}
Loading
Loading