Skip to content

Commit

Permalink
chore(ci): leverage reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
paologallinaharbur committed Mar 7, 2024
1 parent d2b146c commit 651b197
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/on_prerelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,54 @@ on:
- 'v*'

jobs:
consumer-producer-image:
name: Build and push consumer-producer image to use in our canaries
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
path: src/github.com/${{ env.ORIGINAL_REPO_NAME }}
- uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
working-directory: src/github.com/${{ env.ORIGINAL_REPO_NAME }}/tests/integration/consumer-producer
run: |
docker buildx build --push --platform=$CONSUMER_PRODUCER_DOCKER_PLATFORMS \
-t $CONSUMER_PRODUCER_DOCKER_IMAGE_NAME:latest \
.
# This is currently not covered by reusable workflow due to the retry mechanism
test-integration-nix:
name: Run integration tests on *Nix
runs-on: ubuntu-22.04
defaults:
run:
working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: src/github.com/${{env.ORIGINAL_REPO_NAME}}
- name: Install Go
uses: actions/setup-go@v4
with:
go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod'
- name: Integration test
run: for i in 1 2 3; do make integration-test && break; done

pre-release:
needs: [package-win, test-integration-nix]
uses: newrelic/coreint-automation/.github/workflows/reusable_pre_release.yaml@v2
with:
tag: ${{ github.event.release.tag_name }}
integration: kafka
publish_schema: "ohi-jmx"
secrets: inherit
test_integration_nix: false
secrets: inherit


21 changes: 21 additions & 0 deletions .github/workflows/on_push_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,25 @@ jobs:
uses: newrelic/coreint-automation/.github/workflows/reusable_push_pr.yaml@v2
with:
integration: kafka
test_integration_nix: false
secrets: inherit

# This is currently not covered by reusable workflow due to the retry mechanism
test-integration-nix:
name: Run integration tests on *Nix
runs-on: ubuntu-22.04
defaults:
run:
working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: src/github.com/${{env.ORIGINAL_REPO_NAME}}
- name: Install Go
uses: actions/setup-go@v4
with:
go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod'
- name: Integration test
run: for i in 1 2 3; do make integration-test && break; done

0 comments on commit 651b197

Please sign in to comment.