From 4e8de209d41a9699ff70608f61fb25bf77635aa8 Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Thu, 14 Sep 2023 23:14:13 +0200 Subject: [PATCH] chore: move to gh actions Move to GitHub actions. Signed-off-by: Noel Georgi --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++++-- Makefile | 4 +++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 05dd981..64c909c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,9 +11,32 @@ env: jobs: default: permissions: - contents: write packages: write - runs-on: self-hosted + runs-on: + - self-hosted + - X64 + if: ${{ !startsWith(github.head_ref, 'renovate/') || !startsWith(github.head_ref, 'renovate/') }} steps: - name: checkout uses: actions/checkout@v3 + - name: Unshallow + run: | + git fetch --prune --unshallow + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + config-inline: | + [worker.oci] + gc = true + gckeepstorage = 100000 # 100 GiB + + [[worker.oci.gcpolicy]] + keepBytes = 32212254720 # 30 GiB + keepDuration = 604800 + filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout"] + [[worker.oci.gcpolicy]] + all = true + keepBytes = 107374182400 # 100 GiB + - name: build + run: | + make PLATFORM=linux/amd64 diff --git a/Makefile b/Makefile index 2f12e18..fc943a6 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ PLATFORM ?= linux/amd64,linux/arm64 PROGRESS ?= auto PUSH ?= false DEST ?= _out +CI_ARGS ?= COMMON_ARGS := --file=Pkgfile COMMON_ARGS += --provenance=false COMMON_ARGS += --progress=$(PROGRESS) @@ -37,7 +38,8 @@ target-%: ## Builds the specified target defined in the Pkgfile. The build resul @$(BUILD) \ --target=$* \ $(COMMON_ARGS) \ - $(TARGET_ARGS) . + $(TARGET_ARGS) \ + $(CI_ARGS) . local-%: ## Builds the specified target defined in the Pkgfile using the local output type. The build result will be output to the specified local destination. @$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)"