From 23da2c60d434359f267b79cf642db1f9080a1549 Mon Sep 17 00:00:00 2001 From: Marcelo Politzer <251334+mpolitzer@users.noreply.github.com> Date: Tue, 28 Jan 2025 15:00:44 -0300 Subject: [PATCH] feat(CI): get CI working again --- .github/license-check/config.json | 3 +- .github/workflows/build.yml | 35 +++++++++++---------- internal/advancer/machines/machines_test.go | 3 ++ pkg/service/address.go | 3 ++ pkg/service/log.go | 3 ++ 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/license-check/config.json b/.github/license-check/config.json index 741739a79..a45181851 100644 --- a/.github/license-check/config.json +++ b/.github/license-check/config.json @@ -6,7 +6,8 @@ "pkg/contracts/**", "pkg/readerclient/generated.go", "pkg/inspectclient/generated.go", - "rollups-contracts/**" + "rollups-contracts/**", + "internal/repository/postgres/db/**" ], "license": ".github/license-check/header.txt" } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10ef589fc..75fc3e107 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - name=ghcr.io/cartesi/rollups-node-ci + name=ghcr.io/cartesi/rollups-node tags: | type=semver,pattern={{version}} type=ref,event=branch @@ -46,23 +46,26 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: depot/setup-action@v1 - - name: Build and push docker image - id: docker_build - uses: depot/bake-action@v1 + - name: Set up Depot CLI + uses: depot/setup-action@v1 + + - name: Build docker image + uses: depot/build-push-action@v1 with: - files: | - ./docker-bake.hcl - ${{ steps.docker_meta.outputs.bake-file }} - ./docker-bake.platforms.hcl - targets: rollups-node-ci - push: true + file: Dockerfile + context: . + platforms: linux/amd64,linux/arm64 + tags: ${{ github.repository_owner }}/rollups-node:devel.build + push: false + load: true + cache-from: type=gha,scope=debian + cache-to: type=gha,mode=max,scope=debian + build-args: | + DEBUG=${{ (startsWith(github.ref, 'refs/tags/v') && 'no' || 'yes') }} + GIT_COMMIT=${GITHUB_SHA} + MACHINE_EMULATOR_VERSION=${{ env.MACHINE_EMULATOR_VERSION }} project: ${{ vars.DEPOT_PROJECT }} - workdir: build - - - name: Export Image Tag - id : export_tag - run : echo "image_tag=${{steps.docker_meta.outputs.version}}" >> "$GITHUB_OUTPUT" + token: ${{ secrets.DEPOT_TOKEN }} do-basic-checks: runs-on: ubuntu-22.04 diff --git a/internal/advancer/machines/machines_test.go b/internal/advancer/machines/machines_test.go index f44979fc3..17cf8b998 100644 --- a/internal/advancer/machines/machines_test.go +++ b/internal/advancer/machines/machines_test.go @@ -1,3 +1,6 @@ +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) + package machines import ( diff --git a/pkg/service/address.go b/pkg/service/address.go index 7cc6e6da8..7e7b07b05 100644 --- a/pkg/service/address.go +++ b/pkg/service/address.go @@ -1,3 +1,6 @@ +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) + // Implementation of the pflags Value interface. package service diff --git a/pkg/service/log.go b/pkg/service/log.go index 6445c63ae..af33eed79 100644 --- a/pkg/service/log.go +++ b/pkg/service/log.go @@ -1,3 +1,6 @@ +// (c) Cartesi and individual authors (see AUTHORS) +// SPDX-License-Identifier: Apache-2.0 (see LICENSE) + // Implementation of the pflags Value interface. package service