Update mirror #5
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
name: Coordinator CI | |
on: | |
push: | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
name: Filter commit changes | |
outputs: | |
coordinator: ${{ steps.filter.outputs.coordinator }} | |
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: | | |
coordinator: | |
- 'coordinator/**' | |
- 'testdata/**' | |
- 'buildSrc/**' | |
- 'jvm-libs/**' | |
- 'prover/lib/compressor/**' | |
- 'gradle/**' | |
- 'build.gradle' | |
- 'gradle.properties' | |
- 'settings.gradle' | |
- '.github/workflows/coordinator.yml' | |
- '.github/workflows/reuse-*.yml' | |
- 'config/common/traces-limits-v1.toml' | |
- 'config/coordinator/**' | |
- 'e2e/**' | |
- 'contracts/abi/**' | |
- 'contracts/contracts/**' | |
- 'docker/compose.yml' | |
store_image_name_and_tags: | |
uses: ./.github/workflows/reuse-store-image-name-and-tags.yml | |
with: | |
image_name: consensys/linea-coordinator | |
check_image_tags_exist: | |
needs: [ changes, store_image_name_and_tags ] | |
if: ${{ needs.changes.outputs.coordinator == 'false' }} | |
uses: ./.github/workflows/reuse-check-image-tags-exist.yml | |
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: ${{ needs.store_image_name_and_tags.outputs.image_name }} | |
secrets: inherit | |
coordinator-tag-only: | |
needs: [ changes, store_image_name_and_tags, check_image_tags_exist ] | |
if: ${{ needs.changes.outputs.coordinator == 'false' }} | |
uses: ./.github/workflows/reuse-image-tag-push.yml | |
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: ${{ needs.store_image_name_and_tags.outputs.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 }} | |
secrets: inherit | |
run-tests: | |
needs: [ changes, store_image_name_and_tags, coordinator-tag-only ] | |
env: | |
COMMIT_TAG: ${{ needs.store_image_name_and_tags.outputs.commit_tag }} | |
if: ${{ always() && (needs.changes.outputs.coordinator == 'true' || needs.coordinator-tag-only.result != 'success' || needs.coordinator-tag-only.outputs.image_tagged != 'true') }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.15.0 | |
cache: 'pnpm' | |
- name: Npm install | |
run: pnpm i --frozen-lockfile --prefer-offline --filter contracts --ignore-scripts | |
- name: install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Run tests | |
run: | | |
./gradlew -V coordinator:app:buildNeeded check jacocoRootReport --no-daemon | |
- name: Upload Jacoco test coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacocoRootReport-${{ env.COMMIT_TAG }}.xml | |
if-no-files-found: error | |
path: | | |
${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml | |
- name: Setup .NET Core # Required to execute ReportGenerator | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.x | |
dotnet-quality: 'ga' | |
- name: ReportGenerator | |
uses: danielpalme/[email protected] | |
with: | |
reports: '${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/*.xml' | |
targetdir: '${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/coverageReports' | |
reporttypes: MarkdownSummary | |
historydir: '${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/coverageReports' | |
title: 'Kotlin Code Coverage' | |
- name: DeltaReportGenerator | |
uses: danielpalme/[email protected] | |
with: | |
reports: '${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/*.xml' | |
targetdir: '${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/coverageDeltaReports' | |
reporttypes: MarkdownDeltaSummary | |
historydir: '${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/coverageReports' | |
title: 'Kotlin Code Coverage' | |
- name: Upload coverage report artifact | |
id: upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CoverageReport | |
path: | | |
${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/coverageReports | |
- name: Write code coverage delta to PR | |
uses: mshick/add-pr-comment@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
message-path: | | |
${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/coverageDeltaReports/DeltaSummary.md | |
build-and-publish: | |
needs: [ changes, store_image_name_and_tags, coordinator-tag-only ] | |
if: ${{ always() && (needs.changes.outputs.coordinator == 'true' || needs.coordinator-tag-only.result != 'success' || needs.coordinator-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 }} | |
UNTESTED_TAG_SUFFIX: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }} | |
IMAGE_NAME: ${{ needs.store_image_name_and_tags.outputs.image_name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.15.0 | |
cache: 'pnpm' | |
- name: Npm install on contracts | |
run: pnpm i --frozen-lockfile --filter contracts | |
- name: install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
cache-dependency-path: prover/go.sum | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build dist | |
run: | | |
./gradlew coordinator:app:shadowJar --no-daemon | |
- 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: coordinator | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
- name: Build & push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
build-contexts: jar=./coordinator/app/build/libs/ | |
file: ./coordinator/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}-${{ env.UNTESTED_TAG_SUFFIX }} | |
run-e2e-tests: | |
needs: [ changes, store_image_name_and_tags, build-and-publish ] | |
if: ${{ always() && (needs.changes.outputs.coordinator == 'true' || needs.build-and-publish.result == 'success') }} | |
uses: ./.github/workflows/reuse-run-e2e-tests.yml | |
with: | |
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_tag }} | |
untested_tag_suffix: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }} | |
secrets: inherit | |
tag-after-run-tests-success: | |
needs: [ store_image_name_and_tags, run-tests, run-e2e-tests ] | |
if: ${{ always() && needs.run-tests.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' }} | |
uses: ./.github/workflows/reuse-tag-without-untested-suffix.yml | |
with: | |
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_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: ${{ needs.store_image_name_and_tags.outputs.image_name }} | |
secrets: inherit |