From 03a5506040b4565939c949f758baf6fe5b52d929 Mon Sep 17 00:00:00 2001 From: Viktor Baranov Date: Wed, 17 Jan 2024 10:35:25 +0300 Subject: [PATCH 1/5] Generate multiplatform image --- .github/workflows/bens.yml | 17 ++++++++++------- .../workflows/eth-bytecode-db-extractors.yml | 2 +- .github/workflows/eth-bytecode-db.yml | 17 ++++++++++------- .github/workflows/libs.yml | 4 ++-- .github/workflows/multichain-search.yml | 17 ++++++++++------- .github/workflows/sig-provider.yml | 15 +++++++++------ .github/workflows/smart-contract-verifier.yml | 17 ++++++++++------- .github/workflows/stats.yml | 17 ++++++++++------- .github/workflows/user-ops-indexer.yml | 17 ++++++++++------- .github/workflows/visualizer.yml | 17 ++++++++++------- 10 files changed, 82 insertions(+), 58 deletions(-) diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index 1558e187b..08dac5e54 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -39,7 +39,7 @@ jobs: - 5432:5432 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -80,7 +80,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -117,7 +117,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -133,7 +133,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -141,19 +141,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "blockscout-ens" file: "blockscout-ens/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/eth-bytecode-db-extractors.yml b/.github/workflows/eth-bytecode-db-extractors.yml index 1f681ebcb..172aec365 100644 --- a/.github/workflows/eth-bytecode-db-extractors.yml +++ b/.github/workflows/eth-bytecode-db-extractors.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index 73c424773..fbc22d74b 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -39,7 +39,7 @@ jobs: - 5432:5432 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -113,7 +113,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -129,7 +129,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -137,19 +137,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "eth-bytecode-db" file: "eth-bytecode-db/eth-bytecode-db-server/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/libs.yml b/.github/workflows/libs.yml index 32f02641e..14b9bd04f 100644 --- a/.github/workflows/libs.yml +++ b/.github/workflows/libs.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps diff --git a/.github/workflows/multichain-search.yml b/.github/workflows/multichain-search.yml index 28cc72bf7..c18f05a8e 100644 --- a/.github/workflows/multichain-search.yml +++ b/.github/workflows/multichain-search.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 # - name: Install deps # uses: ./.github/actions/deps @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 # - name: Install deps # uses: ./.github/actions/deps @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -114,7 +114,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -122,19 +122,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "multichain-search/backend" file: "multichain-search/backend/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/sig-provider.yml b/.github/workflows/sig-provider.yml index e31c68c9f..4520c57a9 100644 --- a/.github/workflows/sig-provider.yml +++ b/.github/workflows/sig-provider.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -99,7 +99,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -123,19 +123,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: "sig-provider" file: "sig-provider/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/smart-contract-verifier.yml b/.github/workflows/smart-contract-verifier.yml index 443aba337..3aa072c37 100644 --- a/.github/workflows/smart-contract-verifier.yml +++ b/.github/workflows/smart-contract-verifier.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -99,7 +99,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -115,7 +115,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -123,19 +123,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "smart-contract-verifier" file: "smart-contract-verifier/smart-contract-verifier-server/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index 8b74bf3e7..e41f17499 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -40,7 +40,7 @@ jobs: - 5432:5432 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -118,7 +118,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -134,7 +134,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -142,19 +142,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "stats" file: "stats/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index 41b9d8616..145b2203a 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -40,7 +40,7 @@ jobs: - 5432:5432 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -115,7 +115,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -131,7 +131,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -139,19 +139,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "user-ops-indexer" file: "user-ops-indexer/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/visualizer.yml b/.github/workflows/visualizer.yml index 3a179fae7..b9ba97a86 100644 --- a/.github/workflows/visualizer.yml +++ b/.github/workflows/visualizer.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -71,7 +71,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps uses: ./.github/actions/deps @@ -108,7 +108,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 id: regex @@ -124,7 +124,7 @@ jobs: (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -132,19 +132,22 @@ jobs: - name: Extract metadata for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "visualizer" file: "visualizer/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} From 304667a9cdc0aa9a23a1b823f0ead8e5b8372fe1 Mon Sep 17 00:00:00 2001 From: Lymarenko Lev Date: Wed, 17 Jan 2024 17:21:34 +0700 Subject: [PATCH 2/5] Fix dockerfile build for macos --- .github/workflows/bens.yml | 2 +- .github/workflows/eth-bytecode-db.yml | 2 +- .github/workflows/multichain-search.yml | 2 +- .github/workflows/sig-provider.yml | 2 +- .github/workflows/smart-contract-verifier.yml | 2 +- .github/workflows/stats.yml | 2 +- .github/workflows/user-ops-indexer.yml | 2 +- .github/workflows/visualizer.yml | 2 +- .../eth-bytecode-db-server/Dockerfile | 30 +++++++++++-------- .../smart-contract-verifier-http/Dockerfile | 29 +++++++++++------- .../smart-contract-verifier-server/Dockerfile | 29 +++++++++++------- stats/Dockerfile | 29 +++++++++++------- user-ops-indexer/Dockerfile | 29 +++++++++++------- visualizer/Dockerfile | 23 ++++++++------ 14 files changed, 112 insertions(+), 73 deletions(-) diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index 08dac5e54..9caf576f3 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -113,7 +113,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 60 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index 35983d79b..0446f5244 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -115,7 +115,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/multichain-search.yml b/.github/workflows/multichain-search.yml index c18f05a8e..7be0e79d9 100644 --- a/.github/workflows/multichain-search.yml +++ b/.github/workflows/multichain-search.yml @@ -94,7 +94,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/sig-provider.yml b/.github/workflows/sig-provider.yml index 4520c57a9..1193a8ad4 100644 --- a/.github/workflows/sig-provider.yml +++ b/.github/workflows/sig-provider.yml @@ -95,7 +95,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/smart-contract-verifier.yml b/.github/workflows/smart-contract-verifier.yml index 3aa072c37..af5f5b65d 100644 --- a/.github/workflows/smart-contract-verifier.yml +++ b/.github/workflows/smart-contract-verifier.yml @@ -95,7 +95,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index e41f17499..12fa4f0af 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -114,7 +114,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index 145b2203a..8e8b62a97 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -111,7 +111,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/visualizer.yml b/.github/workflows/visualizer.yml index b9ba97a86..747cb886e 100644 --- a/.github/workflows/visualizer.yml +++ b/.github/workflows/visualizer.yml @@ -104,7 +104,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 + timeout-minutes: 90 runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/eth-bytecode-db/eth-bytecode-db-server/Dockerfile b/eth-bytecode-db/eth-bytecode-db-server/Dockerfile index 0bf37f260..955a7b8b1 100644 --- a/eth-bytecode-db/eth-bytecode-db-server/Dockerfile +++ b/eth-bytecode-db/eth-bytecode-db-server/Dockerfile @@ -1,16 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -WORKDIR /app - -RUN apt-get update && apt-get install -y curl wget unzip -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ - && unzip protoc.zip \ - && mv ./include/* /usr/include/ \ - && mv ./bin/protoc /usr/bin/protoc - -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ + && unzip protoc.zip \ + && mv ./include/* /usr/include/ \ + && mv ./bin/protoc /usr/bin/protoc + +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan COPY . . RUN cargo chef prepare --recipe-path recipe.json diff --git a/smart-contract-verifier/smart-contract-verifier-http/Dockerfile b/smart-contract-verifier/smart-contract-verifier-http/Dockerfile index 9eb3fa93c..963cbe361 100644 --- a/smart-contract-verifier/smart-contract-verifier-http/Dockerfile +++ b/smart-contract-verifier/smart-contract-verifier-http/Dockerfile @@ -1,15 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -WORKDIR /app - -RUN apt-get update && apt-get install -y curl wget unzip -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ - && unzip protoc.zip \ - && mv ./include/* /usr/include/ \ - && mv ./bin/protoc /usr/bin/protoc +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ + && unzip protoc.zip \ + && mv ./include/* /usr/include/ \ + && mv ./bin/protoc /usr/bin/protoc + +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan COPY . . diff --git a/smart-contract-verifier/smart-contract-verifier-server/Dockerfile b/smart-contract-verifier/smart-contract-verifier-server/Dockerfile index dc072235d..d8e184ff5 100644 --- a/smart-contract-verifier/smart-contract-verifier-server/Dockerfile +++ b/smart-contract-verifier/smart-contract-verifier-server/Dockerfile @@ -1,15 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -WORKDIR /app - -RUN apt-get update && apt-get install -y curl wget unzip -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ - && unzip protoc.zip \ - && mv ./include/* /usr/include/ \ - && mv ./bin/protoc /usr/bin/protoc +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ + && unzip protoc.zip \ + && mv ./include/* /usr/include/ \ + && mv ./bin/protoc /usr/bin/protoc + +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan COPY . . diff --git a/stats/Dockerfile b/stats/Dockerfile index 83c9cbe34..8da1a577c 100644 --- a/stats/Dockerfile +++ b/stats/Dockerfile @@ -1,15 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -WORKDIR /app - -RUN apt-get update && apt-get install -y curl wget unzip -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ - && unzip protoc.zip \ - && mv ./include/* /usr/include/ \ - && mv ./bin/protoc /usr/bin/protoc +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ + && unzip protoc.zip \ + && mv ./include/* /usr/include/ \ + && mv ./bin/protoc /usr/bin/protoc + +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan COPY . . diff --git a/user-ops-indexer/Dockerfile b/user-ops-indexer/Dockerfile index d30d9cddc..aef1f760e 100644 --- a/user-ops-indexer/Dockerfile +++ b/user-ops-indexer/Dockerfile @@ -1,15 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -WORKDIR /app - -RUN apt-get update && apt-get install -y curl wget unzip -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ - && unzip protoc.zip \ - && mv ./include/* /usr/include/ \ - && mv ./bin/protoc /usr/bin/protoc +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ + && unzip protoc.zip \ + && mv ./include/* /usr/include/ \ + && mv ./bin/protoc /usr/bin/protoc + +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan COPY . . diff --git a/visualizer/Dockerfile b/visualizer/Dockerfile index 380f870cf..7accfd928 100644 --- a/visualizer/Dockerfile +++ b/visualizer/Dockerfile @@ -1,17 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -RUN apt-get update && apt-get install -y curl wget unzip -WORKDIR /app +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef -# Install protoc -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ && unzip protoc.zip \ && mv ./include/* /usr/include/ \ && mv ./bin/protoc /usr/bin/protoc -# Install protoc-gen-openapiv2 -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan From eac51b9fe5fcb5ff1658b3ba6d76b463e9e3e6e9 Mon Sep 17 00:00:00 2001 From: Lymarenko Lev Date: Wed, 17 Jan 2024 20:09:16 +0700 Subject: [PATCH 3/5] Try to fix docker --- .github/workflows/bens.yml | 324 ++++++++--------- .../workflows/eth-bytecode-db-extractors.yml | 88 ++--- .github/workflows/eth-bytecode-db.yml | 328 +++++++++--------- .github/workflows/libs.yml | 132 +++---- .github/workflows/multichain-search.yml | 280 +++++++-------- .github/workflows/sig-provider.yml | 288 +++++++-------- .github/workflows/smart-contract-verifier.yml | 288 +++++++-------- .github/workflows/stats.yml | 326 ++++++++--------- .github/workflows/user-ops-indexer.yml | 320 ++++++++--------- sig-provider/Dockerfile | 29 +- visualizer/Dockerfile | 5 +- 11 files changed, 1207 insertions(+), 1201 deletions(-) diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index 9caf576f3..7c7c3d0d3 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -1,162 +1,162 @@ -on: - push: - branches: - - 'main' - tags: - - 'bens/v*' - pull_request: - paths: - - blockscout-ens/** - - .github/workflows/bens.yml - - .github/actions/deps/** - -name: Test, lint and docker (bens) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/bens - -defaults: - run: - working-directory: blockscout-ens - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: admin - POSTGRES_USER: graph-node - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: blockscout-ens -> target - - - name: Unit tests - run: cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - env: - RUST_BACKTRACE: 1 - RUST_LOG: info - DATABASE_URL: postgres://graph-node:admin@localhost:5432/ - SQLX_OFFLINE: true - - - name: Integration tests - run: cargo test --locked --workspace --test '*' -- --nocapture --include-ignored - if: success() || failure() - env: - RUST_BACKTRACE: 1 - RUST_LOG: info - DATABASE_URL: postgres://graph-node:admin@localhost:5432/ - SQLX_OFFLINE: true - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: blockscout-ens -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/bens\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "blockscout-ens" - file: "blockscout-ens/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'bens/v*' +# pull_request: +# paths: +# - blockscout-ens/** +# - .github/workflows/bens.yml +# - .github/actions/deps/** + +# name: Test, lint and docker (bens) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/bens + +# defaults: +# run: +# working-directory: blockscout-ens + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# services: +# postgres: +# image: postgres +# env: +# POSTGRES_PASSWORD: admin +# POSTGRES_USER: graph-node +# options: >- +# --health-cmd pg_isready +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 5432:5432 +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: blockscout-ens -> target + +# - name: Unit tests +# run: cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() +# env: +# RUST_BACKTRACE: 1 +# RUST_LOG: info +# DATABASE_URL: postgres://graph-node:admin@localhost:5432/ +# SQLX_OFFLINE: true + +# - name: Integration tests +# run: cargo test --locked --workspace --test '*' -- --nocapture --include-ignored +# if: success() || failure() +# env: +# RUST_BACKTRACE: 1 +# RUST_LOG: info +# DATABASE_URL: postgres://graph-node:admin@localhost:5432/ +# SQLX_OFFLINE: true + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: blockscout-ens -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/bens\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "blockscout-ens" +# file: "blockscout-ens/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/eth-bytecode-db-extractors.yml b/.github/workflows/eth-bytecode-db-extractors.yml index 172aec365..c09541f63 100644 --- a/.github/workflows/eth-bytecode-db-extractors.yml +++ b/.github/workflows/eth-bytecode-db-extractors.yml @@ -1,44 +1,44 @@ -on: - push: - branches: - - 'main' - pull_request: - paths: - - eth-bytecode-db-extractors/** - - .github/workflows/eth-bytecode-db-extractors.yml - -name: Lint (eth-bytecode-db-extractors) - -defaults: - run: - working-directory: eth-bytecode-db-extractors - -jobs: - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: eth-bytecode-db-extractors -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings +# on: +# push: +# branches: +# - 'main' +# pull_request: +# paths: +# - eth-bytecode-db-extractors/** +# - .github/workflows/eth-bytecode-db-extractors.yml + +# name: Lint (eth-bytecode-db-extractors) + +# defaults: +# run: +# working-directory: eth-bytecode-db-extractors + +# jobs: +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: eth-bytecode-db-extractors -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index 0446f5244..27c108be1 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -1,164 +1,164 @@ -on: - push: - branches: - - 'main' - tags: - - 'eth-bytecode-db/v*' - pull_request: - paths: - - eth-bytecode-db/** - - .github/workflows/eth-bytecode-db.yml - - .github/actions/deps/** - -name: Test, lint and docker (eth-bytecode-db) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/eth-bytecode-db - -defaults: - run: - working-directory: eth-bytecode-db - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: admin - POSTGRES_USER: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - volumes: - - /tmp/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Copy entrypoint scripts to the volume - run: sudo cp -r ../.github/volumes/docker-entrypoint-initdb.d/* /tmp/docker-entrypoint-initdb.d/ - continue-on-error: false - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: eth-bytecode-db -> target - - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - - - name: Doc tests - run: cargo test --locked --workspace --all-features --doc - if: success() || failure() - - - name: Integration tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture --include-ignored - if: success() || failure() - env: - DATABASE_URL: postgres://postgres:admin@localhost:5432/ - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: eth-bytecode-db -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/eth-bytecode-db\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "eth-bytecode-db" - file: "eth-bytecode-db/eth-bytecode-db-server/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'eth-bytecode-db/v*' +# pull_request: +# paths: +# - eth-bytecode-db/** +# - .github/workflows/eth-bytecode-db.yml +# - .github/actions/deps/** + +# name: Test, lint and docker (eth-bytecode-db) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/eth-bytecode-db + +# defaults: +# run: +# working-directory: eth-bytecode-db + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# services: +# postgres: +# image: postgres +# env: +# POSTGRES_PASSWORD: admin +# POSTGRES_USER: postgres +# options: >- +# --health-cmd pg_isready +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 5432:5432 +# volumes: +# - /tmp/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Copy entrypoint scripts to the volume +# run: sudo cp -r ../.github/volumes/docker-entrypoint-initdb.d/* /tmp/docker-entrypoint-initdb.d/ +# continue-on-error: false + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: eth-bytecode-db -> target + +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() + +# - name: Doc tests +# run: cargo test --locked --workspace --all-features --doc +# if: success() || failure() + +# - name: Integration tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture --include-ignored +# if: success() || failure() +# env: +# DATABASE_URL: postgres://postgres:admin@localhost:5432/ + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: eth-bytecode-db -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/eth-bytecode-db\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "eth-bytecode-db" +# file: "eth-bytecode-db/eth-bytecode-db-server/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/libs.yml b/.github/workflows/libs.yml index 14b9bd04f..c456d5875 100644 --- a/.github/workflows/libs.yml +++ b/.github/workflows/libs.yml @@ -1,81 +1,81 @@ -on: - push: - branches: - - 'main' - pull_request: - paths: - - libs/** - - .github/workflows/libs.yml - - .github/actions/deps/** +# on: +# push: +# branches: +# - 'main' +# pull_request: +# paths: +# - libs/** +# - .github/workflows/libs.yml +# - .github/actions/deps/** -name: Test, lint (libs) +# name: Test, lint (libs) -defaults: - run: - working-directory: libs +# defaults: +# run: +# working-directory: libs -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 - - name: Install deps - uses: ./.github/actions/deps +# - name: Install deps +# uses: ./.github/actions/deps - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: libs -> target +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: libs -> target - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() - - name: Doc tests - run: cargo test --workspace --all-features --doc - if: success() || failure() +# - name: Doc tests +# run: cargo test --workspace --all-features --doc +# if: success() || failure() - # TODO: Uncomment when integration test added - # - name: Integration tests - # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --test '*' -- --nocapture - # if: success() || failure() +# # TODO: Uncomment when integration test added +# # - name: Integration tests +# # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --test '*' -- --nocapture +# # if: success() || failure() - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 - - name: Install deps - uses: ./.github/actions/deps +# - name: Install deps +# uses: ./.github/actions/deps - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: libs -> target +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: libs -> target - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings diff --git a/.github/workflows/multichain-search.yml b/.github/workflows/multichain-search.yml index 7be0e79d9..048eacaa1 100644 --- a/.github/workflows/multichain-search.yml +++ b/.github/workflows/multichain-search.yml @@ -1,143 +1,143 @@ -on: - push: - branches: - - 'main' - tags: - - 'multichain-search/v*' - pull_request: - paths: - - multichain-search/** - - .github/workflows/multichain-search.yml - - -name: Test, lint and docker (multichain-search) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/multichain-search - -defaults: - run: - working-directory: multichain-search - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - # - name: Install deps - # uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: multichain-search -> target - - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - - - name: Doc tests - run: cargo test --locked --workspace --all-features --doc - if: success() || failure() - - - name: Integration tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture - if: success() || failure() - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - # - name: Install deps - # uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: multichain-search -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'multichain-search/v*' +# pull_request: +# paths: +# - multichain-search/** +# - .github/workflows/multichain-search.yml + + +# name: Test, lint and docker (multichain-search) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/multichain-search + +# defaults: +# run: +# working-directory: multichain-search + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# # - name: Install deps +# # uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: multichain-search -> target + +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() + +# - name: Doc tests +# run: cargo test --locked --workspace --all-features --doc +# if: success() || failure() + +# - name: Integration tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture +# if: success() || failure() + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# # - name: Install deps +# # uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: multichain-search -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/multichain-search\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/multichain-search\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "multichain-search/backend" - file: "multichain-search/backend/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "multichain-search/backend" +# file: "multichain-search/backend/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/sig-provider.yml b/.github/workflows/sig-provider.yml index 1193a8ad4..24f7d5626 100644 --- a/.github/workflows/sig-provider.yml +++ b/.github/workflows/sig-provider.yml @@ -1,144 +1,144 @@ -on: - push: - branches: - - 'main' - tags: - - 'sig-provider/v*' - pull_request: - paths: - - sig-provider/** - - .github/workflows/sig-provider.yml - - .github/actions/deps/** - - -name: Test, lint and docker (sig-provider) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/sig-provider - -defaults: - run: - working-directory: sig-provider - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: sig-provider -> target - - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - - - name: Doc tests - run: cargo test --locked --workspace --all-features --doc - if: success() || failure() - - - name: Integration tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture - if: success() || failure() - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: sig-provider -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/sig-provider\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "sig-provider" - file: "sig-provider/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'sig-provider/v*' +# pull_request: +# paths: +# - sig-provider/** +# - .github/workflows/sig-provider.yml +# - .github/actions/deps/** + + +# name: Test, lint and docker (sig-provider) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/sig-provider + +# defaults: +# run: +# working-directory: sig-provider + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: sig-provider -> target + +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() + +# - name: Doc tests +# run: cargo test --locked --workspace --all-features --doc +# if: success() || failure() + +# - name: Integration tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture +# if: success() || failure() + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: sig-provider -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/sig-provider\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "sig-provider" +# file: "sig-provider/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/smart-contract-verifier.yml b/.github/workflows/smart-contract-verifier.yml index af5f5b65d..e3fa5649c 100644 --- a/.github/workflows/smart-contract-verifier.yml +++ b/.github/workflows/smart-contract-verifier.yml @@ -1,144 +1,144 @@ -on: - push: - branches: - - 'main' - tags: - - 'smart-contract-verifier/v*' - pull_request: - paths: - - smart-contract-verifier/** - - .github/workflows/smart-contract-verifier.yml - - .github/actions/deps/** - - -name: Test, lint and docker (smart-contract-verifier) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/smart-contract-verifier - -defaults: - run: - working-directory: smart-contract-verifier - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: smart-contract-verifier -> target - - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - - - name: Doc tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto - if: success() || failure() - - - name: Integration tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture - if: success() || failure() - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: smart-contract-verifier -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/smart-contract-verifier\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "smart-contract-verifier" - file: "smart-contract-verifier/smart-contract-verifier-server/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'smart-contract-verifier/v*' +# pull_request: +# paths: +# - smart-contract-verifier/** +# - .github/workflows/smart-contract-verifier.yml +# - .github/actions/deps/** + + +# name: Test, lint and docker (smart-contract-verifier) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/smart-contract-verifier + +# defaults: +# run: +# working-directory: smart-contract-verifier + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: smart-contract-verifier -> target + +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() + +# - name: Doc tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto +# if: success() || failure() + +# - name: Integration tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture +# if: success() || failure() + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: smart-contract-verifier -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/smart-contract-verifier\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "smart-contract-verifier" +# file: "smart-contract-verifier/smart-contract-verifier-server/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index 12fa4f0af..a8fe9fd53 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -1,163 +1,163 @@ -on: - push: - branches: - - 'main' - tags: - - 'stats/v*' - pull_request: - paths: - - stats/** - - .github/workflows/stats.yml - - .github/actions/deps/** - - -name: Test, lint and docker (stats) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/stats - -defaults: - run: - working-directory: stats - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - services: - postgres: - image: postgres:13.8 - env: - POSTGRES_PASSWORD: admin - POSTGRES_USER: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: stats -> target - - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - - - name: Doc tests - run: cargo test --locked --workspace --all-features --doc - if: success() || failure() - - - name: Integration tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture - if: success() || failure() - - - name: DB tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace -- --nocapture --ignored - if: success() || failure() - env: - DATABASE_URL: postgres://postgres:admin@localhost:5432/ - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: stats -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/stats\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "stats" - file: "stats/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'stats/v*' +# pull_request: +# paths: +# - stats/** +# - .github/workflows/stats.yml +# - .github/actions/deps/** + + +# name: Test, lint and docker (stats) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/stats + +# defaults: +# run: +# working-directory: stats + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# services: +# postgres: +# image: postgres:13.8 +# env: +# POSTGRES_PASSWORD: admin +# POSTGRES_USER: postgres +# options: >- +# --health-cmd pg_isready +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 5432:5432 +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: stats -> target + +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() + +# - name: Doc tests +# run: cargo test --locked --workspace --all-features --doc +# if: success() || failure() + +# - name: Integration tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture +# if: success() || failure() + +# - name: DB tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace -- --nocapture --ignored +# if: success() || failure() +# env: +# DATABASE_URL: postgres://postgres:admin@localhost:5432/ + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: stats -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/stats\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "stats" +# file: "stats/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index 8e8b62a97..9bbf8e391 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -1,160 +1,160 @@ -on: - push: - branches: - - 'main' - tags: - - 'user-ops-indexer/v*' - pull_request: - paths: - - user-ops-indexer/** - - .github/workflows/user-ops-indexer.yml - - .github/actions/deps/** - - -name: Test, lint and docker (user-ops-indexer) - -env: - REGISTRY: ghcr.io - IMAGE_NAME: blockscout/user-ops-indexer - -defaults: - run: - working-directory: user-ops-indexer - -jobs: - test: - name: Unit, doc and integration tests - runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: admin - POSTGRES_USER: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: user-ops-indexer -> target - - - name: Unit tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture - if: success() || failure() - env: - DATABASE_URL: postgres://postgres:admin@localhost:5432/ - - - name: Doc tests - run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto - if: success() || failure() - - # TODO: Uncomment when integration test added - # - name: Integration tests - # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture - # if: success() || failure() - - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install deps - uses: ./.github/actions/deps - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt, clippy - override: true - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - workspaces: user-ops-indexer -> target - - - name: cargo fmt - run: cargo fmt --all -- --check --config imports_granularity=Crate - - - name: cargo clippy - run: cargo clippy --all --all-targets --all-features -- -D warnings - - push: - name: Docker build and docker push - needs: - - test - - lint - if: | - always() && - (needs.test.result == 'success' || needs.test.result == 'cancelled') && - (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/user-ops-indexer\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "user-ops-indexer" - file: "user-ops-indexer/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +# on: +# push: +# branches: +# - 'main' +# tags: +# - 'user-ops-indexer/v*' +# pull_request: +# paths: +# - user-ops-indexer/** +# - .github/workflows/user-ops-indexer.yml +# - .github/actions/deps/** + + +# name: Test, lint and docker (user-ops-indexer) + +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: blockscout/user-ops-indexer + +# defaults: +# run: +# working-directory: user-ops-indexer + +# jobs: +# test: +# name: Unit, doc and integration tests +# runs-on: ubuntu-latest +# services: +# postgres: +# image: postgres +# env: +# POSTGRES_PASSWORD: admin +# POSTGRES_USER: postgres +# options: >- +# --health-cmd pg_isready +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 5432:5432 +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# override: true + +# - name: Rust cache +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: user-ops-indexer -> target + +# - name: Unit tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture +# if: success() || failure() +# env: +# DATABASE_URL: postgres://postgres:admin@localhost:5432/ + +# - name: Doc tests +# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto +# if: success() || failure() + +# # TODO: Uncomment when integration test added +# # - name: Integration tests +# # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture +# # if: success() || failure() + +# lint: +# name: Linting +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 + +# - name: Install deps +# uses: ./.github/actions/deps + +# - name: Install toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# profile: minimal +# components: rustfmt, clippy +# override: true + +# - uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# workspaces: user-ops-indexer -> target + +# - name: cargo fmt +# run: cargo fmt --all -- --check --config imports_granularity=Crate + +# - name: cargo clippy +# run: cargo clippy --all --all-targets --all-features -- -D warnings + +# push: +# name: Docker build and docker push +# needs: +# - test +# - lint +# if: | +# always() && +# (needs.test.result == 'success' || needs.test.result == 'cancelled') && +# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') +# timeout-minutes: 90 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - uses: actions-ecosystem/action-regex-match@v2 +# id: regex +# with: +# text: ${{ github.ref }} +# regex: '^(refs\/tags\/user-ops-indexer\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + +# - name: Extract tag name +# id: tags_extractor +# run: | +# t=${{ steps.regex.outputs.group2 }} +# m=${{ steps.regex.outputs.group4 }} +# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Extract metadata for Docker +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: "user-ops-indexer" +# file: "user-ops-indexer/Dockerfile" +# push: ${{ steps.tags_extractor.outputs.tags != '' }} +# tags: ${{ steps.tags_extractor.outputs.tags }} +# platforms: | +# linux/amd64 +# linux/arm64/v8 +# labels: ${{ steps.meta.outputs.labels }} +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache +# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/sig-provider/Dockerfile b/sig-provider/Dockerfile index 99d117240..8084e6a2b 100644 --- a/sig-provider/Dockerfile +++ b/sig-provider/Dockerfile @@ -1,15 +1,22 @@ -FROM lukemathwalker/cargo-chef:0.1.62-rust-1.72-buster as chef -WORKDIR /app - -RUN apt-get update && apt-get install -y curl wget unzip -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip \ - && unzip protoc.zip \ - && mv ./include/* /usr/include/ \ - && mv ./bin/protoc /usr/bin/protoc +FROM lukemathwalker/cargo-chef:0.1.62-rust-1.74-buster as chef -RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2 \ - && chmod +x protoc-gen-openapiv2 \ - && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 +WORKDIR /app +ARG TARGETARCH +RUN case ${TARGETARCH} in \ + "arm64") TARGETARCH=aarch_64 ;; \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-$TARGETARCH.zip -O ./protoc.zip \ + && unzip protoc.zip \ + && mv ./include/* /usr/include/ \ + && mv ./bin/protoc /usr/bin/protoc + +RUN case ${TARGETARCH} in \ + "amd64") TARGETARCH=x86_64 ;; \ + esac \ + && wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-$TARGETARCH -O ./protoc-gen-openapiv2 \ + && chmod +x protoc-gen-openapiv2 \ + && mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2 FROM chef AS plan COPY . . diff --git a/visualizer/Dockerfile b/visualizer/Dockerfile index 7accfd928..f44a339d2 100644 --- a/visualizer/Dockerfile +++ b/visualizer/Dockerfile @@ -33,9 +33,8 @@ RUN cargo build --release FROM node:16-bullseye-slim WORKDIR /usr/src/ -# sol2uml needed phantom which installation needed bzip2 -RUN apt-get update && apt-get install bzip2 \ - && npm install phantom \ + +RUN apt-get update && apt-get install -y chromium \ && npm link sol2uml@2.1 --only=production COPY --from=build /app/target/release/visualizer-server ./ From 65a7c1ddf3d58054893b4c7eafdc4454cd1999d2 Mon Sep 17 00:00:00 2001 From: Lymarenko Lev Date: Thu, 18 Jan 2024 13:23:55 +0700 Subject: [PATCH 4/5] Update timeout --- .github/workflows/bens.yml | 324 ++++++++--------- .../workflows/eth-bytecode-db-extractors.yml | 88 ++--- .github/workflows/eth-bytecode-db.yml | 328 +++++++++--------- .github/workflows/libs.yml | 132 +++---- .github/workflows/multichain-search.yml | 280 +++++++-------- .github/workflows/sig-provider.yml | 288 +++++++-------- .github/workflows/smart-contract-verifier.yml | 288 +++++++-------- .github/workflows/stats.yml | 326 ++++++++--------- .github/workflows/user-ops-indexer.yml | 320 ++++++++--------- .github/workflows/visualizer.yml | 2 +- 10 files changed, 1188 insertions(+), 1188 deletions(-) diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index 7c7c3d0d3..77a46d3d9 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -1,162 +1,162 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'bens/v*' -# pull_request: -# paths: -# - blockscout-ens/** -# - .github/workflows/bens.yml -# - .github/actions/deps/** - -# name: Test, lint and docker (bens) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/bens - -# defaults: -# run: -# working-directory: blockscout-ens - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# services: -# postgres: -# image: postgres -# env: -# POSTGRES_PASSWORD: admin -# POSTGRES_USER: graph-node -# options: >- -# --health-cmd pg_isready -# --health-interval 10s -# --health-timeout 5s -# --health-retries 5 -# ports: -# - 5432:5432 -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: blockscout-ens -> target - -# - name: Unit tests -# run: cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() -# env: -# RUST_BACKTRACE: 1 -# RUST_LOG: info -# DATABASE_URL: postgres://graph-node:admin@localhost:5432/ -# SQLX_OFFLINE: true - -# - name: Integration tests -# run: cargo test --locked --workspace --test '*' -- --nocapture --include-ignored -# if: success() || failure() -# env: -# RUST_BACKTRACE: 1 -# RUST_LOG: info -# DATABASE_URL: postgres://graph-node:admin@localhost:5432/ -# SQLX_OFFLINE: true - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: blockscout-ens -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/bens\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "blockscout-ens" -# file: "blockscout-ens/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +on: + push: + branches: + - 'main' + tags: + - 'bens/v*' + pull_request: + paths: + - blockscout-ens/** + - .github/workflows/bens.yml + - .github/actions/deps/** + +name: Test, lint and docker (bens) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/bens + +defaults: + run: + working-directory: blockscout-ens + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: admin + POSTGRES_USER: graph-node + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: blockscout-ens -> target + + - name: Unit tests + run: cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + env: + RUST_BACKTRACE: 1 + RUST_LOG: info + DATABASE_URL: postgres://graph-node:admin@localhost:5432/ + SQLX_OFFLINE: true + + - name: Integration tests + run: cargo test --locked --workspace --test '*' -- --nocapture --include-ignored + if: success() || failure() + env: + RUST_BACKTRACE: 1 + RUST_LOG: info + DATABASE_URL: postgres://graph-node:admin@localhost:5432/ + SQLX_OFFLINE: true + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: blockscout-ens -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/bens\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "blockscout-ens" + file: "blockscout-ens/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/eth-bytecode-db-extractors.yml b/.github/workflows/eth-bytecode-db-extractors.yml index c09541f63..172aec365 100644 --- a/.github/workflows/eth-bytecode-db-extractors.yml +++ b/.github/workflows/eth-bytecode-db-extractors.yml @@ -1,44 +1,44 @@ -# on: -# push: -# branches: -# - 'main' -# pull_request: -# paths: -# - eth-bytecode-db-extractors/** -# - .github/workflows/eth-bytecode-db-extractors.yml - -# name: Lint (eth-bytecode-db-extractors) - -# defaults: -# run: -# working-directory: eth-bytecode-db-extractors - -# jobs: -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: eth-bytecode-db-extractors -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings +on: + push: + branches: + - 'main' + pull_request: + paths: + - eth-bytecode-db-extractors/** + - .github/workflows/eth-bytecode-db-extractors.yml + +name: Lint (eth-bytecode-db-extractors) + +defaults: + run: + working-directory: eth-bytecode-db-extractors + +jobs: + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: eth-bytecode-db-extractors -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index 27c108be1..75fd8f8a5 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -1,164 +1,164 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'eth-bytecode-db/v*' -# pull_request: -# paths: -# - eth-bytecode-db/** -# - .github/workflows/eth-bytecode-db.yml -# - .github/actions/deps/** - -# name: Test, lint and docker (eth-bytecode-db) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/eth-bytecode-db - -# defaults: -# run: -# working-directory: eth-bytecode-db - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# services: -# postgres: -# image: postgres -# env: -# POSTGRES_PASSWORD: admin -# POSTGRES_USER: postgres -# options: >- -# --health-cmd pg_isready -# --health-interval 10s -# --health-timeout 5s -# --health-retries 5 -# ports: -# - 5432:5432 -# volumes: -# - /tmp/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Copy entrypoint scripts to the volume -# run: sudo cp -r ../.github/volumes/docker-entrypoint-initdb.d/* /tmp/docker-entrypoint-initdb.d/ -# continue-on-error: false - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: eth-bytecode-db -> target - -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() - -# - name: Doc tests -# run: cargo test --locked --workspace --all-features --doc -# if: success() || failure() - -# - name: Integration tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture --include-ignored -# if: success() || failure() -# env: -# DATABASE_URL: postgres://postgres:admin@localhost:5432/ - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: eth-bytecode-db -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/eth-bytecode-db\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "eth-bytecode-db" -# file: "eth-bytecode-db/eth-bytecode-db-server/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +on: + push: + branches: + - 'main' + tags: + - 'eth-bytecode-db/v*' + pull_request: + paths: + - eth-bytecode-db/** + - .github/workflows/eth-bytecode-db.yml + - .github/actions/deps/** + +name: Test, lint and docker (eth-bytecode-db) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/eth-bytecode-db + +defaults: + run: + working-directory: eth-bytecode-db + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: admin + POSTGRES_USER: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + volumes: + - /tmp/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Copy entrypoint scripts to the volume + run: sudo cp -r ../.github/volumes/docker-entrypoint-initdb.d/* /tmp/docker-entrypoint-initdb.d/ + continue-on-error: false + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: eth-bytecode-db -> target + + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + + - name: Doc tests + run: cargo test --locked --workspace --all-features --doc + if: success() || failure() + + - name: Integration tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture --include-ignored + if: success() || failure() + env: + DATABASE_URL: postgres://postgres:admin@localhost:5432/ + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: eth-bytecode-db -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/eth-bytecode-db\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "eth-bytecode-db" + file: "eth-bytecode-db/eth-bytecode-db-server/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/libs.yml b/.github/workflows/libs.yml index c456d5875..14b9bd04f 100644 --- a/.github/workflows/libs.yml +++ b/.github/workflows/libs.yml @@ -1,81 +1,81 @@ -# on: -# push: -# branches: -# - 'main' -# pull_request: -# paths: -# - libs/** -# - .github/workflows/libs.yml -# - .github/actions/deps/** +on: + push: + branches: + - 'main' + pull_request: + paths: + - libs/** + - .github/workflows/libs.yml + - .github/actions/deps/** -# name: Test, lint (libs) +name: Test, lint (libs) -# defaults: -# run: -# working-directory: libs +defaults: + run: + working-directory: libs -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 -# - name: Install deps -# uses: ./.github/actions/deps + - name: Install deps + uses: ./.github/actions/deps -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: libs -> target + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: libs -> target -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() -# - name: Doc tests -# run: cargo test --workspace --all-features --doc -# if: success() || failure() + - name: Doc tests + run: cargo test --workspace --all-features --doc + if: success() || failure() -# # TODO: Uncomment when integration test added -# # - name: Integration tests -# # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --test '*' -- --nocapture -# # if: success() || failure() + # TODO: Uncomment when integration test added + # - name: Integration tests + # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --workspace --test '*' -- --nocapture + # if: success() || failure() -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 -# - name: Install deps -# uses: ./.github/actions/deps + - name: Install deps + uses: ./.github/actions/deps -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: libs -> target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: libs -> target -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings diff --git a/.github/workflows/multichain-search.yml b/.github/workflows/multichain-search.yml index 048eacaa1..91cbcaa24 100644 --- a/.github/workflows/multichain-search.yml +++ b/.github/workflows/multichain-search.yml @@ -1,143 +1,143 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'multichain-search/v*' -# pull_request: -# paths: -# - multichain-search/** -# - .github/workflows/multichain-search.yml - - -# name: Test, lint and docker (multichain-search) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/multichain-search - -# defaults: -# run: -# working-directory: multichain-search - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# # - name: Install deps -# # uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: multichain-search -> target - -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() - -# - name: Doc tests -# run: cargo test --locked --workspace --all-features --doc -# if: success() || failure() - -# - name: Integration tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture -# if: success() || failure() - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# # - name: Install deps -# # uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: multichain-search -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 +on: + push: + branches: + - 'main' + tags: + - 'multichain-search/v*' + pull_request: + paths: + - multichain-search/** + - .github/workflows/multichain-search.yml + + +name: Test, lint and docker (multichain-search) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/multichain-search + +defaults: + run: + working-directory: multichain-search + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + # - name: Install deps + # uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: multichain-search -> target + + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + + - name: Doc tests + run: cargo test --locked --workspace --all-features --doc + if: success() || failure() + + - name: Integration tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture + if: success() || failure() + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + # - name: Install deps + # uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: multichain-search -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/multichain-search\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/multichain-search\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "multichain-search/backend" -# file: "multichain-search/backend/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "multichain-search/backend" + file: "multichain-search/backend/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/sig-provider.yml b/.github/workflows/sig-provider.yml index 24f7d5626..576cf3c28 100644 --- a/.github/workflows/sig-provider.yml +++ b/.github/workflows/sig-provider.yml @@ -1,144 +1,144 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'sig-provider/v*' -# pull_request: -# paths: -# - sig-provider/** -# - .github/workflows/sig-provider.yml -# - .github/actions/deps/** - - -# name: Test, lint and docker (sig-provider) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/sig-provider - -# defaults: -# run: -# working-directory: sig-provider - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: sig-provider -> target - -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() - -# - name: Doc tests -# run: cargo test --locked --workspace --all-features --doc -# if: success() || failure() - -# - name: Integration tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture -# if: success() || failure() - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: sig-provider -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/sig-provider\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "sig-provider" -# file: "sig-provider/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +on: + push: + branches: + - 'main' + tags: + - 'sig-provider/v*' + pull_request: + paths: + - sig-provider/** + - .github/workflows/sig-provider.yml + - .github/actions/deps/** + + +name: Test, lint and docker (sig-provider) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/sig-provider + +defaults: + run: + working-directory: sig-provider + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: sig-provider -> target + + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + + - name: Doc tests + run: cargo test --locked --workspace --all-features --doc + if: success() || failure() + + - name: Integration tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture + if: success() || failure() + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: sig-provider -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/sig-provider\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "sig-provider" + file: "sig-provider/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/smart-contract-verifier.yml b/.github/workflows/smart-contract-verifier.yml index e3fa5649c..52903a757 100644 --- a/.github/workflows/smart-contract-verifier.yml +++ b/.github/workflows/smart-contract-verifier.yml @@ -1,144 +1,144 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'smart-contract-verifier/v*' -# pull_request: -# paths: -# - smart-contract-verifier/** -# - .github/workflows/smart-contract-verifier.yml -# - .github/actions/deps/** - - -# name: Test, lint and docker (smart-contract-verifier) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/smart-contract-verifier - -# defaults: -# run: -# working-directory: smart-contract-verifier - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: smart-contract-verifier -> target - -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() - -# - name: Doc tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto -# if: success() || failure() - -# - name: Integration tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture -# if: success() || failure() - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: smart-contract-verifier -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/smart-contract-verifier\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "smart-contract-verifier" -# file: "smart-contract-verifier/smart-contract-verifier-server/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +on: + push: + branches: + - 'main' + tags: + - 'smart-contract-verifier/v*' + pull_request: + paths: + - smart-contract-verifier/** + - .github/workflows/smart-contract-verifier.yml + - .github/actions/deps/** + + +name: Test, lint and docker (smart-contract-verifier) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/smart-contract-verifier + +defaults: + run: + working-directory: smart-contract-verifier + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: smart-contract-verifier -> target + + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + + - name: Doc tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto + if: success() || failure() + + - name: Integration tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture + if: success() || failure() + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: smart-contract-verifier -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/smart-contract-verifier\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "smart-contract-verifier" + file: "smart-contract-verifier/smart-contract-verifier-server/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index a8fe9fd53..4e6870907 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -1,163 +1,163 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'stats/v*' -# pull_request: -# paths: -# - stats/** -# - .github/workflows/stats.yml -# - .github/actions/deps/** - - -# name: Test, lint and docker (stats) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/stats - -# defaults: -# run: -# working-directory: stats - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# services: -# postgres: -# image: postgres:13.8 -# env: -# POSTGRES_PASSWORD: admin -# POSTGRES_USER: postgres -# options: >- -# --health-cmd pg_isready -# --health-interval 10s -# --health-timeout 5s -# --health-retries 5 -# ports: -# - 5432:5432 -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: stats -> target - -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() - -# - name: Doc tests -# run: cargo test --locked --workspace --all-features --doc -# if: success() || failure() - -# - name: Integration tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture -# if: success() || failure() - -# - name: DB tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace -- --nocapture --ignored -# if: success() || failure() -# env: -# DATABASE_URL: postgres://postgres:admin@localhost:5432/ - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: stats -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/stats\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "stats" -# file: "stats/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +on: + push: + branches: + - 'main' + tags: + - 'stats/v*' + pull_request: + paths: + - stats/** + - .github/workflows/stats.yml + - .github/actions/deps/** + + +name: Test, lint and docker (stats) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/stats + +defaults: + run: + working-directory: stats + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + services: + postgres: + image: postgres:13.8 + env: + POSTGRES_PASSWORD: admin + POSTGRES_USER: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: stats -> target + + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + + - name: Doc tests + run: cargo test --locked --workspace --all-features --doc + if: success() || failure() + + - name: Integration tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture + if: success() || failure() + + - name: DB tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace -- --nocapture --ignored + if: success() || failure() + env: + DATABASE_URL: postgres://postgres:admin@localhost:5432/ + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: stats -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/stats\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "stats" + file: "stats/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index 9bbf8e391..816e5e107 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -1,160 +1,160 @@ -# on: -# push: -# branches: -# - 'main' -# tags: -# - 'user-ops-indexer/v*' -# pull_request: -# paths: -# - user-ops-indexer/** -# - .github/workflows/user-ops-indexer.yml -# - .github/actions/deps/** - - -# name: Test, lint and docker (user-ops-indexer) - -# env: -# REGISTRY: ghcr.io -# IMAGE_NAME: blockscout/user-ops-indexer - -# defaults: -# run: -# working-directory: user-ops-indexer - -# jobs: -# test: -# name: Unit, doc and integration tests -# runs-on: ubuntu-latest -# services: -# postgres: -# image: postgres -# env: -# POSTGRES_PASSWORD: admin -# POSTGRES_USER: postgres -# options: >- -# --health-cmd pg_isready -# --health-interval 10s -# --health-timeout 5s -# --health-retries 5 -# ports: -# - 5432:5432 -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# override: true - -# - name: Rust cache -# uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: user-ops-indexer -> target - -# - name: Unit tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture -# if: success() || failure() -# env: -# DATABASE_URL: postgres://postgres:admin@localhost:5432/ - -# - name: Doc tests -# run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto -# if: success() || failure() - -# # TODO: Uncomment when integration test added -# # - name: Integration tests -# # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture -# # if: success() || failure() - -# lint: -# name: Linting -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 - -# - name: Install deps -# uses: ./.github/actions/deps - -# - name: Install toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# profile: minimal -# components: rustfmt, clippy -# override: true - -# - uses: Swatinem/rust-cache@v2 -# with: -# cache-on-failure: true -# workspaces: user-ops-indexer -> target - -# - name: cargo fmt -# run: cargo fmt --all -- --check --config imports_granularity=Crate - -# - name: cargo clippy -# run: cargo clippy --all --all-targets --all-features -- -D warnings - -# push: -# name: Docker build and docker push -# needs: -# - test -# - lint -# if: | -# always() && -# (needs.test.result == 'success' || needs.test.result == 'cancelled') && -# (needs.lint.result == 'success' || needs.lint.result == 'cancelled') -# timeout-minutes: 90 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - uses: actions-ecosystem/action-regex-match@v2 -# id: regex -# with: -# text: ${{ github.ref }} -# regex: '^(refs\/tags\/user-ops-indexer\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - -# - name: Extract tag name -# id: tags_extractor -# run: | -# t=${{ steps.regex.outputs.group2 }} -# m=${{ steps.regex.outputs.group4 }} -# (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} - -# - name: Extract metadata for Docker -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build and push -# uses: docker/build-push-action@v5 -# with: -# context: "user-ops-indexer" -# file: "user-ops-indexer/Dockerfile" -# push: ${{ steps.tags_extractor.outputs.tags != '' }} -# tags: ${{ steps.tags_extractor.outputs.tags }} -# platforms: | -# linux/amd64 -# linux/arm64/v8 -# labels: ${{ steps.meta.outputs.labels }} -# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache -# cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} +on: + push: + branches: + - 'main' + tags: + - 'user-ops-indexer/v*' + pull_request: + paths: + - user-ops-indexer/** + - .github/workflows/user-ops-indexer.yml + - .github/actions/deps/** + + +name: Test, lint and docker (user-ops-indexer) + +env: + REGISTRY: ghcr.io + IMAGE_NAME: blockscout/user-ops-indexer + +defaults: + run: + working-directory: user-ops-indexer + +jobs: + test: + name: Unit, doc and integration tests + runs-on: ubuntu-latest + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: admin + POSTGRES_USER: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: user-ops-indexer -> target + + - name: Unit tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture + if: success() || failure() + env: + DATABASE_URL: postgres://postgres:admin@localhost:5432/ + + - name: Doc tests + run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --doc -- --skip proto + if: success() || failure() + + # TODO: Uncomment when integration test added + # - name: Integration tests + # run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --test '*' -- --nocapture + # if: success() || failure() + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install deps + uses: ./.github/actions/deps + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rustfmt, clippy + override: true + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + workspaces: user-ops-indexer -> target + + - name: cargo fmt + run: cargo fmt --all -- --check --config imports_granularity=Crate + + - name: cargo clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + push: + name: Docker build and docker push + needs: + - test + - lint + if: | + always() && + (needs.test.result == 'success' || needs.test.result == 'cancelled') && + (needs.lint.result == 'success' || needs.lint.result == 'cancelled') + timeout-minutes: 300 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ github.ref }} + regex: '^(refs\/tags\/user-ops-indexer\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' + + - name: Extract tag name + id: tags_extractor + run: | + t=${{ steps.regex.outputs.group2 }} + m=${{ steps.regex.outputs.group4 }} + (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "user-ops-indexer" + file: "user-ops-indexer/Dockerfile" + push: ${{ steps.tags_extractor.outputs.tags != '' }} + tags: ${{ steps.tags_extractor.outputs.tags }} + platforms: | + linux/amd64 + linux/arm64/v8 + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache + cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/visualizer.yml b/.github/workflows/visualizer.yml index 747cb886e..449682ca8 100644 --- a/.github/workflows/visualizer.yml +++ b/.github/workflows/visualizer.yml @@ -104,7 +104,7 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 90 + timeout-minutes: 300 runs-on: ubuntu-latest steps: - name: Checkout repository From a30277579245d83a77e2f55150704427f0f5378b Mon Sep 17 00:00:00 2001 From: Rim Rakhimov Date: Thu, 1 Feb 2024 15:49:59 +0400 Subject: [PATCH 5/5] Make arm builds only on tags --- .github/workflows/bens.yml | 6 +++--- .github/workflows/eth-bytecode-db.yml | 6 +++--- .github/workflows/multichain-search.yml | 6 +++--- .github/workflows/sig-provider.yml | 6 +++--- .github/workflows/smart-contract-verifier.yml | 6 +++--- .github/workflows/stats.yml | 6 +++--- .github/workflows/user-ops-indexer.yml | 6 +++--- .github/workflows/visualizer.yml | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index 264fbe849..944f93a01 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -153,14 +153,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "blockscout-ens" file: "blockscout-ens/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index eb8f9efac..93070c3dc 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -164,14 +164,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "eth-bytecode-db" file: "eth-bytecode-db/eth-bytecode-db-server/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/multichain-search.yml b/.github/workflows/multichain-search.yml index 2bd31c60f..2fe3f8d29 100644 --- a/.github/workflows/multichain-search.yml +++ b/.github/workflows/multichain-search.yml @@ -132,14 +132,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "multichain-search/backend" file: "multichain-search/backend/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/sig-provider.yml b/.github/workflows/sig-provider.yml index 4e035fb11..58fd9c9da 100644 --- a/.github/workflows/sig-provider.yml +++ b/.github/workflows/sig-provider.yml @@ -134,14 +134,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "sig-provider" file: "sig-provider/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/smart-contract-verifier.yml b/.github/workflows/smart-contract-verifier.yml index d1eb2fd5f..7dedba37d 100644 --- a/.github/workflows/smart-contract-verifier.yml +++ b/.github/workflows/smart-contract-verifier.yml @@ -134,14 +134,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "smart-contract-verifier" file: "smart-contract-verifier/smart-contract-verifier-server/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index 8e2b435fc..7b6f2f371 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -153,14 +153,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "stats" file: "stats/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index ebf5da6d9..d85eba224 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -150,14 +150,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "user-ops-indexer" file: "user-ops-indexer/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/visualizer.yml b/.github/workflows/visualizer.yml index b968d2bb3..5454fdf61 100644 --- a/.github/workflows/visualizer.yml +++ b/.github/workflows/visualizer.yml @@ -143,14 +143,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 + env: + PLATFORMS: ${{ steps.tags_extractor.outputs.tags != '' && 'linux/amd64,linux/arm64/v8' || 'linux/amd64' }} with: context: "visualizer" file: "visualizer/Dockerfile" push: ${{ steps.tags_extractor.outputs.tags != '' }} tags: ${{ steps.tags_extractor.outputs.tags }} - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ env.PLATFORMS }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }}