Skip to content

feat: add storage-aware cache management with LRU eviction and analytics #35

feat: add storage-aware cache management with LRU eviction and analytics

feat: add storage-aware cache management with LRU eviction and analytics #35

Workflow file for this run

name: 🚥 CI/CD
on:
workflow_dispatch:
push:
branches:
- '**'
pull_request:
branches:
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: 🧹 Go Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- name: Check formatting
run: test -z "$(gofmt -l .)"
test-unit:
name: 🧪 Go Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- run: go test ./...
benchmark:
name: 📊 Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- name: Run benchmarks
env:
BENCH_FILE_SIZES_MB: '10,50'
BENCH_BUFFER_SIZES_KB: '64,256'
run: go test ./... -bench . -benchmem -run ^$ -benchtime=1x
deploy-build:
if: github.event_name == 'push'
name: 🚀 Build (${{ matrix.suffix }})
permissions:
packages: write
contents: read
needs: [lint, test-unit, benchmark]
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
outputs: type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true
- name: Upload digest
run: |
mkdir -p /tmp/digests
touch "/tmp/digests/${DIGEST#sha256:}"
env:
DIGEST: ${{ steps.build.outputs.digest }}
- uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.suffix }}
path: /tmp/digests/*
retention-days: 1
deploy-merge:
if: github.event_name == 'push'
name: 🚀 Create manifest
permissions:
packages: write
contents: read
needs: [deploy-build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create -t "ghcr.io/${{ github.repository }}:${GITHUB_REF_NAME//\//_}" \
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)