Skip to content

proton-bridge: gRPC metrics exporter (prototype) #6

proton-bridge: gRPC metrics exporter (prototype)

proton-bridge: gRPC metrics exporter (prototype) #6

Workflow file for this run

name: pr
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
with:
cache: true
- name: Lint
run: ./scripts/lint.sh
matrix:
runs-on: ubuntu-latest
needs: [lint]
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
count: ${{ steps.gen.outputs.count }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: jdx/mise-action@v2
with:
cache: true
- id: gen
shell: bash
run: |
set -euo pipefail
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
matrix_json="$(python scripts/ci_matrix.py changed --base "$base" --head "$head" --json)"
count="$(echo "$matrix_json" | jq '.include | length')"
echo "count=$count" >> "$GITHUB_OUTPUT"
echo "matrix<<EOF" >> "$GITHUB_OUTPUT"
echo "$matrix_json" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
needs: [matrix]
if: needs.matrix.outputs.count != '0'
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
with:
cache: true
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Lint Dockerfile
run: hadolint "${{ matrix.dir }}/Dockerfile"
- id: build-args
shell: bash
run: |
set -euo pipefail
image_source="${{ github.server_url }}/${{ github.repository }}"
{
echo "value<<EOF"
jq -r '.[]' <<< '${{ toJSON(matrix.build_args) }}'
echo "ENV_IMAGE_SOURCE=${image_source}"
echo "ENV_IMAGE_REVISION=${{ github.sha }}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build (no push)
uses: docker/build-push-action@v6
with:
context: ${{ matrix.dir }}
file: ${{ matrix.dir }}/Dockerfile
platforms: ${{ join(matrix.platforms, ',') }}
build-args: ${{ steps.build-args.outputs.value }}
push: false
provenance: false
sbom: false
tags: local/${{ matrix.image_name }}:pr-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max