From 248556409e6e7de2e89a7d006673b6216b9946ac Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Wed, 5 Feb 2025 09:43:29 -0500 Subject: [PATCH 1/2] ci(branches): run CI on golang branches and PRs (#19) (cherry picked from commit 5266ea4862e65136d2f41c88fff8e7e89456abd7) --- .github/workflows/ci.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 198bb2e14..69d239f62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,14 @@ concurrency: on: workflow_dispatch: + pull_request: + branches: + - main + - master + - v[0-9]+ + - v[0-9]+.[0-9]+ + - cryostat-v[0-9]+.[0-9]+ + - go-* push: branches: - main @@ -13,6 +21,7 @@ on: - v[0-9]+ - v[0-9]+.[0-9]+ - cryostat-v[0-9]+.[0-9]+ + - go-* tags: - '*' @@ -27,9 +36,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install qemu continue-on-error: false + if: github.event_name != 'pull_request' run: | sudo apt-get update sudo apt-get install -y qemu-user-static @@ -55,8 +65,8 @@ jobs: uses: redhat-actions/buildah-build@v2 with: image: ${{ env.CI_IMG }} - archs: amd64, arm64 - tags: ${{ github.ref_name }} ${{ github.ref == 'refs/heads/main' && 'latest' || '' }} ${{ env.DATE_TAG }} ${{ steps.check-branch.outputs.image-tag }} ${{ steps.check-commit.outputs.image-tag }} ${{ steps.check-commit.outputs.image-tag-patch }} ${{ steps.check-commit.outputs.image-tag-release }} + archs: ${{ github.event_name == 'pull_request' && 'amd64' || 'amd64, arm64' }} + tags: ${{ github.event_name != 'pull_request' && github.ref_name || '' }} ${{ github.ref == 'refs/heads/main' && 'latest' || '' }} ${{ env.DATE_TAG }} ${{ steps.check-branch.outputs.image-tag }} ${{ steps.check-commit.outputs.image-tag }} ${{ steps.check-commit.outputs.image-tag-patch }} ${{ steps.check-commit.outputs.image-tag-release }} containerfiles: | ./Containerfile - name: Push to quay.io @@ -68,7 +78,7 @@ jobs: registry: ${{ env.CI_REGISTRY }} username: ${{ env.CI_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - if: ${{ github.repository_owner == 'cryostatio' }} + if: ${{ github.repository_owner == 'cryostatio' && github.event_name != 'pull_request' }} - name: Print image URL run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" - if: ${{ github.repository_owner == 'cryostatio' }} + if: ${{ github.repository_owner == 'cryostatio' && github.event_name != 'pull_request' }} From 2dffbcf5fee339cc10ceef88761b7f7d71508f27 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Wed, 5 Feb 2025 09:48:47 -0500 Subject: [PATCH 2/2] fixup! ci(branches): run CI on golang branches and PRs (#19) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69d239f62..7b09cf975 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: archs: ${{ github.event_name == 'pull_request' && 'amd64' || 'amd64, arm64' }} tags: ${{ github.event_name != 'pull_request' && github.ref_name || '' }} ${{ github.ref == 'refs/heads/main' && 'latest' || '' }} ${{ env.DATE_TAG }} ${{ steps.check-branch.outputs.image-tag }} ${{ steps.check-commit.outputs.image-tag }} ${{ steps.check-commit.outputs.image-tag-patch }} ${{ steps.check-commit.outputs.image-tag-release }} containerfiles: | - ./Containerfile + ./Dockerfile - name: Push to quay.io id: push-to-quay uses: redhat-actions/push-to-registry@v2