Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): run required checks on merge groups #1192

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
merge_group:

jobs:
build:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/check-dagger-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
merge_group:

jobs:
check-dagger-drift:
Expand All @@ -26,13 +27,13 @@ jobs:
with:
path: bin
key: daggercli-download-${{ steps.dagger_version.outputs.version }}

- name: Install Dagger CLI
if: steps.cache_daggercli.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ steps.dagger_version.outputs.version }} sh

- name: Check drift
run: |
set -e
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ on:
- v*
pull_request:
branches:
- '*'
- "*"
paths-ignore:
- 'docs/**'
- '.github/workflows/publish-page.yml'
- "docs/**"
- ".github/workflows/publish-page.yml"
merge_group:

permissions:
contents: read
Expand All @@ -35,7 +36,7 @@ jobs:
platform:
- linux/amd64
- linux/arm64

steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand All @@ -53,40 +54,40 @@ jobs:
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Login to DockerHub
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
uses: grafana/shared-workflows/actions/dockerhub-login@main

- name: Build and push by digest
id: build
uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0
with:
context: .
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name == 'push' }}

- name: Export digest
id: digest
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
touch "/tmp/digests/${digest#sha256:}"
echo "artifact_name=digests-${{ matrix.platform }}" | sed -e 's/\//-/g' >> "$GITHUB_OUTPUT"

- name: Upload digest
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ steps.digest.outputs.artifact_name }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs:
if: github.event_name == 'push'
needs:
- build
steps:
- name: Download digests (linux/amd64)
Expand All @@ -109,7 +110,7 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
Expand All @@ -124,7 +125,7 @@ jobs:
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ on:
- reopened
branches:
- main
merge_group:

jobs:
lint-pr-title:
runs-on: ubuntu-latest
steps:
- uses: grafana/shared-workflows/actions/lint-pr-title@main
- uses: grafana/shared-workflows/actions/lint-pr-title@90e72fd7b35f5d30696313aeb736a13a15eb82ad # lint-pr-title-v1.0.0
env:
GITHUB_TOKEN: ${{ github.token }}

7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- main
pull_request:
branches:
- '*'
- "*"
merge_group:

jobs:
lint:
Expand All @@ -15,15 +16,15 @@ jobs:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./.github/actions/setup-goversion
- run: make lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./.github/actions/setup-goversion
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: '3.13.1'
version: "3.13.1"
- name: Install jsonnet
run: go install github.com/google/go-jsonnet/cmd/[email protected]
- run: make test
Expand Down
Loading