mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 07:28:05 -05:00
Co-authored-by: Franklin Delehelle <franklin.delehelle@odena.eu> Co-authored-by: Alexandre Belling <alexandrebelling8@gmail.com> Co-authored-by: Pedro Novais <jpvnovais@gmail.com> Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com> Co-authored-by: Bradley Bown <bradbown@googlemail.com> Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com> Co-authored-by: Nikolai Golub <nikolai.golub@consensys.net> Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com> Co-authored-by: jonesho <81145364+jonesho@users.noreply.github.com> Co-authored-by: Gaurav Ahuja <gauravahuja9@gmail.com> Co-authored-by: Azam Soleimanian <49027816+Soleimani193@users.noreply.github.com> Co-authored-by: Andrei A <andrei.alexandru@consensys.net> Co-authored-by: Arijit Dutta <37040536+arijitdutta67@users.noreply.github.com> Co-authored-by: Gautam Botrel <gautam.botrel@gmail.com> Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net> Co-authored-by: gusiri <dreamerty@postech.ac.kr> Co-authored-by: FlorianHuc <florian.huc@gmail.com> Co-authored-by: Arya Tabaie <arya.pourtabatabaie@gmail.com> Co-authored-by: Julink <julien.fontanel@consensys.net> Co-authored-by: Bogdan Ursu <bogdanursuoffice@gmail.com> Co-authored-by: Jakub Trąd <jakubtrad@gmail.com> Co-authored-by: Alessandro Sforzin <alessandro.sforzin@consensys.net> Co-authored-by: Olivier Bégassat <olivier.begassat.cours@gmail.com> Co-authored-by: Steve Huang <97596526+stevehuangc7s@users.noreply.github.com> Co-authored-by: bkolad <blazejkolad@gmail.com> Co-authored-by: fadyabuhatoum1 <139905934+fadyabuhatoum1@users.noreply.github.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> Co-authored-by: Eduardo Andrade <eduardofandrade@gmail.com> Co-authored-by: Ivo Kubjas <tsimmm@gmail.com> Co-authored-by: Ludcour <ludovic.courcelas@consensys.net> Co-authored-by: m4sterbunny <harrie.bickle@consensys.net> Co-authored-by: Alex Panayi <145478258+alexandrospanayi@users.noreply.github.com> Co-authored-by: Diana Borbe - ConsenSys <diana.borbe@consensys.net> Co-authored-by: ThomasPiellard <thomas.piellard@gmail.com>
133 lines
5.1 KiB
YAML
133 lines
5.1 KiB
YAML
name: All tools CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'operations/**'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'operations/**'
|
|
|
|
env:
|
|
DOCKER_IMAGE_NAME: consensys/linea-alltools
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
name: Filter commit changes
|
|
outputs:
|
|
all-tools: ${{ steps.filter.outputs.all-tools }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Filter commit changes
|
|
uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
base: ${{ github.ref }}
|
|
list-files: "json"
|
|
filters: |
|
|
all-tools:
|
|
- 'operations/**'
|
|
- '.github/workflows/all-tools.yml'
|
|
- '.github/workflows/reuse-*.yml'
|
|
|
|
store_image_name_and_tags:
|
|
uses: ./.github/workflows/reuse-store-image-name-and-tags.yml
|
|
|
|
check_image_tags_exist:
|
|
runs-on: ubuntu-latest
|
|
name: Check image tags exist
|
|
needs: [ changes, store_image_name_and_tags ]
|
|
if: ${{ needs.changes.outputs.all-tools == 'false' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Check image tags exist
|
|
uses: ./.github/actions/check-image-tags-exist
|
|
with:
|
|
last_commit_tag: ${{ needs.store_image_name_and_tags.outputs.last_commit_tag }}
|
|
common_ancestor_tag: ${{ needs.store_image_name_and_tags.outputs.common_ancestor_tag }}
|
|
image_name: ${{ env.DOCKER_IMAGE_NAME }}
|
|
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
all-tools-tag-only:
|
|
runs-on: ubuntu-latest
|
|
name: All tools tag only
|
|
needs: [ changes, store_image_name_and_tags, check_image_tags_exist ]
|
|
if: ${{ github.event_name != 'pull_request' && needs.changes.outputs.all-tools == 'false' }}
|
|
outputs:
|
|
image_tagged: ${{ steps.image_tag_push.outputs.image_tagged }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Tag and push image
|
|
id: image_tag_push
|
|
uses: ./.github/actions/image-tag-and-push
|
|
with:
|
|
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
|
|
last_commit_tag: ${{ needs.store_image_name_and_tags.outputs.last_commit_tag }}
|
|
common_ancestor_tag: ${{ needs.store_image_name_and_tags.outputs.common_ancestor_tag }}
|
|
develop_tag: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
|
|
untested_tag_suffix: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }}
|
|
image_name: ${{ env.DOCKER_IMAGE_NAME }}
|
|
last_commit_tag_exists: ${{ needs.check_image_tags_exist.outputs.last_commit_tag_exists }}
|
|
common_ancestor_commit_tag_exists: ${{ needs.check_image_tags_exist.outputs.common_ancestor_commit_tag_exists }}
|
|
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
build-and-publish:
|
|
needs: [ changes, store_image_name_and_tags, all-tools-tag-only ]
|
|
if: ${{ always() && (needs.changes.outputs.all-tools == 'true' || needs.all-tools-tag-only.result != 'success' || needs.all-tools-tag-only.outputs.image_tagged != 'true') }}
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
COMMIT_TAG: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
|
|
DEVELOP_TAG: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
|
|
IMAGE_NAME: ${{ env.DOCKER_IMAGE_NAME }}
|
|
name: All tools build and push
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ssh-key: ${{ secrets.SELF_GITHUB_SSH_KEY }}
|
|
submodules: true
|
|
persist-credentials: false
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
# Note: Building arm* images on QEMU emulator can get extremely slow
|
|
# when downloading large packages with npm / yarn. Arm* based docker
|
|
# images are not necessarily needed as we run amd64 machines for most
|
|
# cases. We can later set up self-hosted arm64 github runners if we
|
|
# want arm* based images back.
|
|
# - name: Set up QEMU
|
|
# uses: docker/setup-qemu-action@v3
|
|
# with:
|
|
# platforms: 'arm64,arm'
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Show the "version" build argument
|
|
run: |
|
|
echo "We inject the commit tag in the docker image ${{ env.COMMIT_TAG }}"
|
|
echo COMMIT_TAG=${{ env.COMMIT_TAG }} >> $GITHUB_ENV
|
|
- name: Build and push all tools image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./operations/Dockerfile
|
|
platforms: linux/amd64
|
|
# Note: Build amd64 image only
|
|
# platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: |
|
|
${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}
|
|
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
|