Skip to content

Cesar/update main

Cesar/update main #1

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency:
# Cancel any running workflow for the same branch when new commits are pushed.
# We group both by ref_name (available when CI is triggered by a push to a branch/tag)
# and head_ref (available when CI is triggered by a PR).
group: "${{ github.ref_name }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
format:
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Format
run: make fmt check/unstaged-changes
check-generated:
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Check generated files
run: make generate check/unstaged-changes
check-example-templates:
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Check example templates
run: make examples/check-templates
test:
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
go_test_flags:
- "-race -cover"
- ""
# Compute runner OS dynamically based on arch and repo ownership
runs-on: >-
${{
github.repository_owner == 'grafana'
&& format('ubuntu-{0}-large', matrix.arch)
|| (matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04')
}}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Go Mod
run: make check/go/mod
- name: Test
run: make go/test GO_TEST_FLAGS="${{ matrix.go_test_flags }}"
test-integration:
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
go_test_flags: ["-race -cover", ""]
# Compute runner OS dynamically based on arch and repo ownership
runs-on: >-
${{
github.repository_owner == 'grafana'
&& format('ubuntu-{0}-large', matrix.arch)
|| (matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04')
}}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Integration Test
run: make go/test-integration GO_TEST_FLAGS="${{ matrix.go_test_flags }}"
lint:
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Run linter
run: make lint
- name: Check helm manifests
run: make helm/check check/unstaged-changes
test-docs:
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-small' || 'ubuntu-latest' }}
steps:
- name: "Check out code"
uses: "actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5" # v4
with:
persist-credentials: false
- name: "Test docs"
run: make docs/test
build-image:
if: github.event_name != 'push'
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64' || 'ubuntu-latest' }}
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Set up go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Build image Pyroscope
run: make docker-image/pyroscope/build-multiarch "BUILDX_ARGS=--cache-from=type=gha --cache-to=type=gha"
build-push:
if: github.event_name == 'push' && github.repository == 'grafana/pyroscope'
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
outputs:
image: ${{ steps.push-metadata.outputs.image }}
image-digest: ${{ steps.push-metadata.outputs.image-digest }}
image-tag: ${{ steps.push-metadata.outputs.image-tag }}
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Set up go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.25.12
- name: Log into GAR
uses: grafana/shared-workflows/actions/login-to-gar@c7ad5f57693ac858c698d95783685a9cbfd91223 # login-to-gar/v1.0.1
with:
registry: us-docker.pkg.dev
- name: Pyroscope Build & push multi-arch image
id: build-push
run: |
make docker-image/pyroscope/push-multiarch "BUILDX_ARGS=--cache-from=type=gha --cache-to=type=gha"
- name: Get image, image tag and image digest
id: push-metadata
run: |
image=$(cat ./.docker-image-name-pyroscope)
echo "image=${image}" >> "$GITHUB_OUTPUT"
echo "image-tag=${image#*:}" >> "$GITHUB_OUTPUT"
echo "image-digest=$(cat ./.docker-image-digest-pyroscope)" >> "$GITHUB_OUTPUT"
deploy-dev:
permissions:
contents: read
id-token: write
if: github.event_name == 'push' && github.repository == 'grafana/pyroscope' && github.ref == 'refs/heads/main'
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-small' || 'ubuntu-latest' }}
needs: [build-push]
steps:
- id: "submit-argowfs-deployment"
name: "Submit Argo Workflows deployment"
uses: grafana/shared-workflows/actions/trigger-argo-workflow@c2f1df59dba624b3fd509e5181aa8da5217120c0
with:
namespace: "phlare-cd"
workflow_template: "deploy-pyroscope-dev"
parameters: |
dockertag=${{ needs.build-push.outputs.image-tag }}
commit=${{ github.sha }}
- name: Print URI
run: |
echo "URI: ${{ steps.submit-argowfs-deployment.outputs.uri }}"