Skip to content

FOSSA Scan - Do Not Merge #264

FOSSA Scan - Do Not Merge

FOSSA Scan - Do Not Merge #264

Workflow file for this run

name: New Relic Fluent Bit Output Plugin - Pull Request
on: [pull_request]
jobs:
unit-tests:
name: CI - Tests and Build
runs-on: ubuntu-20.04
steps:
# We can't go past 1.20.X until this issue is solved: https://github.com/golang/go/issues/62130#issuecomment-1687335898
- name: Set up Go 1.20.7
uses: actions/setup-go@v4
with:
go-version: '1.20.7'
id: go
- name: Check go version
run: go version
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests
run: |
go install -v github.com/jstemmer/go-junit-report@latest
go test -v ./... 2>&1 | go-junit-report -set-exit-code=1 > test-results.xml
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.6.2
if: always()
with:
files: test-results.xml
- name: Build project
run: make linux/amd64
docker-ci:
name: CI - Docker image build (${{ matrix.name }})
runs-on: ubuntu-20.04
services:
registry:
image: registry:2
ports:
- 5000:5000
strategy:
matrix:
include:
- name: standard-image
dockerfile: Dockerfile
platforms: linux/amd64, linux/arm64, linux/arm/v7
- name: debug-image
dockerfile: Dockerfile_debug
platforms: linux/amd64, linux/arm64
- name: firelens-image
dockerfile: Dockerfile_firelens
# Firelens image only available for amd64 and arm64 architectures
platforms: linux/amd64, linux/arm64
steps:
- name: Checkout code
uses: actions/checkout@v2
# The QEMU will include more platforms such as arm64 to docker buildx builder
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# The Docker Buildx builder will be used later to leverage from the cache while building the image
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
# This option is required to avoid this problem https://github.com/docker/for-mac/issues/3611#issuecomment-479507361
# We need this option to be able to push to the local registry service used by the integration tests.
driver-opts: network=host
# Cache to be used by Docker Buildx
- name: Set up Docker Buildx's cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
- name: Build Docker image (${{ matrix.name }})
uses: docker/build-push-action@v2
with:
context: ./
file: ./${{ matrix.dockerfile }}
push: true
tags: localhost:5000/fb-output-plugin-${{ matrix.name }}
builder: ${{ steps.buildx.outputs.name }}
platforms: ${{ matrix.platforms }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Inspect generated Docker image (${{ matrix.name }})
run: docker buildx imagetools inspect localhost:5000/fb-output-plugin-${{ matrix.name }}
- name: Test Docker image (${{ matrix.name }})
run: bash test.sh localhost:5000/fb-output-plugin-${{ matrix.name }}
docker-windows-ci:
name: CI - Docker image for ${{ matrix.name }}
# We aim to support https://kubernetes.io/docs/setup/production-environment/windows/intro-windows-in-kubernetes/#windows-os-version-support
# More info: https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#choose_your_windows_server_node_image
# Tag reference: https://hub.docker.com/_/microsoft-windows-servercore
# Compatibility matrix: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility
strategy:
matrix:
include:
- name: Windows Server 2019 (LTSC)
windowsImageTag: ltsc2019-amd64
imageTagSuffix: windows-ltsc-2019
runsOn: windows-2019
- name: Windows Server 2022 (LTSC)
windowsImageTag: ltsc2022-amd64
imageTagSuffix: windows-ltsc-2022
runsOn: windows-2022
runs-on: ${{ matrix.runsOn }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build container for ${{ matrix.name }}
env:
DOCKERHUB_REPOSITORY: newrelic/newrelic-fluentbit-output
IMAGE_TAG: development-${{ matrix.imageTagSuffix }}
run: |
docker build -f Dockerfile.windows -t ${{ env.DOCKERHUB_REPOSITORY }}:${{ env.IMAGE_TAG }} --build-arg WINDOWS_VERSION=${{ matrix.windowsImageTag }} .