Zombie Builder #92
Workflow file for this run
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
# | |
# Copyright Quadrivium LLC | |
# All Rights Reserved | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
name : Zombie Builder | |
on: | |
# schedule: | |
# - cron: '0 2 * * 0' # Update zombie builder image each Sunday night | |
workflow_dispatch: | |
env: | |
POLKADOT_BINARY_REPO: ${{ secrets.GCP_REGISTRY_PATH }}/polkadot-sdk-bin | |
BUILD_DIR: build | |
KAGOME_IN_DOCKER: 1 | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
GITHUB_HUNTER_USERNAME: ${{ secrets.HUNTER_USERNAME }} | |
GITHUB_HUNTER_TOKEN: ${{ secrets.HUNTER_TOKEN }} | |
# Change all container: values to this variable once this feature is available | |
# https://github.jparrowsec.cnmunity/t/how-to-set-and-access-a-workflow-variable/17335/6 | |
CACHE_VERSION: v07 | |
CACHE_PATHS: | | |
~/Library/Caches/pip | |
~/.cargo | |
~/.ccache | |
~/.hunter | |
~/.rustup | |
jobs: | |
# get_polkadot_binary_image: | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 120 | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v4 | |
# | |
# - id: 'auth' | |
# uses: 'google-github-actions/auth@v2' | |
# with: | |
# credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
# | |
# - name: 'Set up Cloud SDK' | |
# uses: 'google-github-actions/setup-gcloud@v2' | |
# | |
# - name: "Configure Docker for GCR" | |
# run: | | |
# echo ${GOOGLE_APPLICATION_CREDENTIALS} | |
# gcloud auth configure-docker | |
# build_and_push_zombie_builder: | |
# runs-on: [ actions-runner-controller ] | |
# timeout-minutes: 120 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: build zombie-builder | |
# working-directory: ./zombienet/docker | |
# run: make builder_latest | |
# - uses: azure/docker-login@v2 | |
# with: | |
# login-server: https://index.docker.io/v1/ | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_TOKEN }} | |
# - name: Push zombie-builder docker image | |
# working-directory: ./zombienet/docker | |
# run: make builder_push | |
build_polkadot_builder: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: "Configure Docker for GCR" | |
run: | | |
echo ${GOOGLE_APPLICATION_CREDENTIALS} | |
gcloud auth configure-docker | |
- name: Get Polkadot and Zombienet versions | |
run: make get_versions | |
- name: Check if image tag exists | |
id: check-tag | |
run: | | |
TAG_VERSION=$(grep 'polkadot_format_version:' polkadot-sdk-versions.txt | cut -d ' ' -f 2) | |
TAG_EXISTS=$(docker manifest inspect ${POLKADOT_BINARY_REPO}:${TAG_VERSION} > /dev/null 2>&1 && echo "yes" || echo "no") | |
echo "exists=$TAG_EXISTS" >> $GITHUB_ENV | |
- name: Build Polkadot Builder | |
if: env.exists == 'no' | |
run: make fetch_and_run POLKADOT_BINARY_REPO=${POLKADOT_BINARY_REPO} | |
- name: Push Polkadot Builder | |
if: env.exists == 'no' | |
run: make builder_push POLKADOT_BINARY_REPO=${POLKADOT_BINARY_REPO} |