mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 15:38:06 -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>
108 lines
3.1 KiB
YAML
108 lines
3.1 KiB
YAML
name: Traces-api-facade build and publish CI
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
commit_tag:
|
|
required: true
|
|
type: string
|
|
last_commit_tag:
|
|
required: true
|
|
type: string
|
|
common_ancestor_tag:
|
|
required: true
|
|
type: string
|
|
develop_tag:
|
|
required: true
|
|
type: string
|
|
untested_tag_suffix:
|
|
required: true
|
|
type: string
|
|
image_name:
|
|
required: true
|
|
type: string
|
|
secrets:
|
|
DOCKERHUB_USERNAME:
|
|
required: true
|
|
DOCKERHUB_TOKEN:
|
|
required: true
|
|
workflow_dispatch:
|
|
inputs:
|
|
coverage:
|
|
description: To generate test report
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
name: Traces api build
|
|
env:
|
|
COMMIT_TAG: ${{ inputs.commit_tag }}
|
|
DEVELOP_TAG: ${{ inputs.develop_tag }}
|
|
UNTESTED_TAG_SUFFIX: ${{ inputs.untested_tag_suffix }}
|
|
IMAGE_NAME: ${{ inputs.image_name }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.head_ref }}
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
- name: Run tests with coverage
|
|
uses: nick-fields/retry@v2
|
|
if: ${{ inputs.coverage }}
|
|
with:
|
|
max_attempts: 2
|
|
retry_on: error
|
|
timeout_minutes: 20
|
|
command: |
|
|
./gradlew traces-api-facade:app:buildNeeded jacocoRootReport
|
|
- name: Run tests without coverage
|
|
uses: nick-fields/retry@v2
|
|
if: ${{ !inputs.coverage }}
|
|
with:
|
|
max_attempts: 2
|
|
retry_on: error
|
|
timeout_minutes: 20
|
|
command: |
|
|
./gradlew traces-api-facade:app:buildNeeded
|
|
- name: Build dist
|
|
run: |
|
|
./gradlew traces-api-facade:app:shadowJar
|
|
echo ${{ github.workspace }}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
- name: Login to Docker Hub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Docker meta
|
|
id: traces-api-facade
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: consensys/linea-traces-api-facade
|
|
- name: Build & push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
build-contexts: jar=./traces-api-facade/app/build/libs/
|
|
file: ./traces-api-facade/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}-${{ env.UNTESTED_TAG_SUFFIX }}
|
|
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
|