Skip to content

Commit

Permalink
feat: orchestract pull request CI from one file
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Mar 21, 2024
1 parent 09e1f9f commit 3858542
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 36 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/lint-go.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Lint

on:
push:
branches:
- master
pull_request:
workflow_call:

permissions:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull Request CI

on:
pull_request:
branches:
- master

jobs:

run-unit-tests:
name: Run Unit Tests
uses: ./.github/workflows/test.yaml

lint:
name: Lint
uses: ./.github/workflows/lint-go.yaml

# This doesn't publish the image, it just tests the publishing workflow (build the image / tags / labels)
test-docker-publish:
name: Test Docker Publish
uses: ./.github/workflows/publish-docker-image.yaml
secrets: inherit
needs:
- run-unit-tests
- lint
permissions:
contents: read
packages: write
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.ref }}-${{ github.sha }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
push: ${{ github.event_name != 'pull_request' }}
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/test-docker-build.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Unit Tests

on:
pull_request:
branches:
- master
workflow_call:

jobs:
Expand Down

0 comments on commit 3858542

Please sign in to comment.