Skip to content

add runner to matrix #1

add runner to matrix

add runner to matrix #1

name: Build Core images
on:
workflow_call:
secrets:
DOCKERHUB_USER:
description: "DOCKERHUB_USER"
required: true
DOCKERHUB_TOKEN:
description: "DOCKERHUB_TOKEN"
required: true
inputs:
image_tag:
description: "Tag of a built image to deploy"
type: string
required: true
image_tag_suffix:
description: "Optional suffix to override tag name generation"
type: string
required: false
action:
description: "Action with docker image"
type: string
default: "push"
required: false
jobs:
build-images:
name: Build and Push Docker Images
env:
image_tag: ${{ inputs.image_tag }}
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}

Check failure on line 30 in .github/workflows/build-core-template.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-core-template.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
runs-on: [ ${{ matrix.component.runner }} ]
strategy:
matrix:
component:
- name: server-v2
platforms: linux/amd64
runner: matterlabs-ci-runner
- name: external-node
platforms: linux/amd64
runner: matterlabs-ci-runner
- name: external-node
platforms: linux/arm64
runner: matterlabs-ci-runner-arm
- name: contract-verifier
platforms: linux/amd64
runner: matterlabs-ci-runner
- name: cross-external-nodes-checker
platforms: linux/amd64
runner: matterlabs-ci-runner
- name: snapshots-creator
platforms: linux/amd64
runner: matterlabs-ci-runner
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
submodules: "recursive"
- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo CI=1 >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo CI=1 >> .env
echo IN_DOCKER=1 >> .env
- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contracts
path: ./contracts/
- name: start-services
run: |
echo "IMAGE_TAG_SUFFIX=${{ env.IMAGE_TAG_SUFFIX }}" >> .env
mkdir -p ./volumes/postgres
docker compose up -d zk postgres
ci_run sccache --start-server
- name: init
run: |
ci_run git config --global --add safe.directory /usr/src/zksync
ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
ci_run docker buildx create --name multiarch --use
ci_run zk
ci_run zk clean --all
ci_run zk run yarn
ci_run curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key
- name: login to Docker registries
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
ci_run docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
ci_run gcloud auth configure-docker us-docker.pkg.dev,asia-docker.pkg.dev,europe-docker.pkg.dev -q
- name: update-images
env:
DOCKER_ACTION: ${{ inputs.action }}
COMPONENT: ${{ matrix.component.name }}
PLATFORMS: ${{ matrix.component.platforms }}
run: |
ci_run rustup default nightly-2023-08-21
ci_run zk docker $DOCKER_ACTION --platforms=${PLATFORMS} $COMPONENT
- name: Show sccache stats
if: always()
run: |
ci_run sccache --show-stats
ci_run cat /tmp/sccache_log.txt