Skip to content

Commit

Permalink
workflows: simplify integration test (#4490)
Browse files Browse the repository at this point in the history
* workflows: rename fuzz workflow file to match pr- prefix

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: refactor integration image usage

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: image cleanup

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: temporarily select current branch

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix linting issues

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix linting issues

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: ensure we use gchr.io

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: add helper documentation

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: updated README

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: reverted to using master branch

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: invoke reusable Grafana workflow

Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored Dec 21, 2021
1 parent 089e3c8 commit 48a74ca
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 268 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

| Workflow file | Description | Run event |
| :---------------------------------------------------- | ------------------------ | ------------------------------------------------- |
| [master-integration-test](./master-integration-test.yaml) | Runs the integration testing suite on master | on new commit/push on master|
| [staging-build](./staging-build.yaml) | Builds the distro packages and docker images from a tagged release into staging (S3 and GHCR) | on new release/tag |
| [staging-test](./staging-test.yaml) | Test the staging distro packages and docker images| manually or when `staging-build` completes successfully |
| [staging-release](./staging-release.yaml) | Publishes the docker images/manifest on hub.docker.io/fluent/ and the distro packages | manual approval |
| [pr-closed-docker](./pr-closed-docker.yaml) | Removes docker images for PR on hub.docker.io/fluentbitdev/| on pr closed|
| [pr-compile-check](./pr-compile-check.yaml) | Runs some compilation sanity checks on a PR |
| [pr-integration-test](./pr-integration-test.yaml) | Runs the integration testing suite on a PR branch | pr opened / label created 'ok-to-test' / on new commit/push on PR(s) |
| [pr-stale](./pr-stale.yaml) | Closes stale PR(s) with no activity in 30 days | scheduled daily 01:30 AM UTC|
| [integration-build-master](./integration-build-master.yaml) | Builds a docker image to be used in integration testing (master branch) | on new commit/push on master|
| [integration-build-pr](./integration-build-pr.yaml) | Builds a docker image to be used in integration testing (pr branch) | on new commit/push on PR(s) |
| [integration-run-master](./integration-run-master.yaml) | Runs the integration testing suite on master | on new image built|
| [integration-run-pr](./integration-run-pr.yaml) | Runs the integration testing suite on a PR branch | pr opened / label created 'ok-to-test' |
| [unit-tests](./unit-tests.yaml) | Runs the unit tests suite on master push or new PR | PR opened, merge in master branch |

## Available labels
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/call-integration-image-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Reusable workflow for integration testing
on:
workflow_call:
inputs:
ref:
description: The SHA, commit or branch to checkout and build.
required: true
type: string
registry:
description: The registry to push container images to.
type: string
required: true
username:
description: The username for the registry.
type: string
required: true
image:
description: The name of the container image to push to the registry.
type: string
required: true
image-tag:
description: The tag of the image to for testing.
type: string
required: true
environment:
description: The Github environment to run this workflow on.
type: string
required: false
secrets:
token:
description: The Github token or similar to authenticate with for the registry.
required: true
jobs:
call-integration-image-build-container:
name: Integration test container image build
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.ref }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ secrets.token }}

- name: Extract metadata from Github
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ inputs.registry }}/${{ inputs.image }}
tags: |
raw,${{ inputs.image-tag }}
- name: Build the AMD64 image
uses: docker/build-push-action@v2
with:
file: ./dockerfiles/Dockerfile.x86_64-master
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
push: true
load: false

- name: Extract metadata from Github
id: meta-debug
uses: docker/metadata-action@v3
with:
images: ${{ inputs.registry }}/${{ inputs.image }}
tags: |
raw,${{ inputs.image-tag }}-debug
- name: Build the AMD64 development image
uses: docker/build-push-action@v2
with:
file: ./dockerfiles/Dockerfile.x86_64-master_debug
context: .
tags: ${{ steps.meta-debug.outputs.tags }}
labels: ${{ steps.meta-debug.outputs.labels }}
platforms: linux/amd64
push: true
load: false
39 changes: 0 additions & 39 deletions .github/workflows/integration-build-master.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/integration-build-pr.yaml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/integration-run-master.yaml

This file was deleted.

99 changes: 0 additions & 99 deletions .github/workflows/integration-run-pr.yaml

This file was deleted.

Loading

0 comments on commit 48a74ca

Please sign in to comment.