Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 27 additions & 116 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,136 +128,47 @@ jobs:
pip install ruff
make format-check

vars:
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.vars.outputs.tag }}
stackrox-io-image: ${{ steps.vars.outputs.stackrox-io-image }}
rhacs-eng-image: ${{ steps.vars.outputs.rhacs-eng-image }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- id: vars
run: |
cat << EOF >> "$GITHUB_OUTPUT"
tag=$(make tag)
stackrox-io-image=$(make image-name)
rhacs-eng-image=$(FACT_REGISTRY="quay.io/rhacs-eng/fact" make image-name)
EOF

container:
needs:
- vars
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
env:
FACT_TAG: ${{ needs.vars.outputs.tag }}-${{ matrix.arch }}
FACT_VERSION: ${{ needs.vars.outputs.tag }}
STACKROX_IO_IMAGE: ${{ needs.vars.outputs.stackrox-io-image }}-${{ matrix.arch }}
RHACS_ENG_IMAGE: ${{ needs.vars.outputs.rhacs-eng-image }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build image
run: DOCKER=podman make image

- name: Login to quay.io/stackrox-io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- run: podman push "${STACKROX_IO_IMAGE}"

- name: Login to quay.io/rhacs-eng
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}

- name: Tag and push to rhacs-eng
run: |
podman tag "${STACKROX_IO_IMAGE}" "${RHACS_ENG_IMAGE}"
podman push "${RHACS_ENG_IMAGE}"

manifest-stackrox-io:
runs-on: ubuntu-24.04
needs:
- container
- vars
env:
ARCHS: amd64 arm64
steps:
- uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- name: Create multiarch manifest
run: |
podman manifest create ${{ needs.vars.outputs.stackrox-io-image }} \
${{ needs.vars.outputs.stackrox-io-image }}-amd64 \
${{ needs.vars.outputs.stackrox-io-image }}-arm64
podman manifest inspect ${{ needs.vars.outputs.stackrox-io-image }}
podman manifest push ${{ needs.vars.outputs.stackrox-io-image }}

manifest-rhacs-eng:
runs-on: ubuntu-24.04
needs:
- container
- vars
env:
ARCHS: amd64 arm64
steps:
- uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}
container-build:
uses: ./.github/workflows/container-build.yml
secrets: inherit

- name: Create multiarch manifest
run: |
podman manifest create ${{ needs.vars.outputs.rhacs-eng-image }} \
${{ needs.vars.outputs.rhacs-eng-image }}-amd64 \
${{ needs.vars.outputs.rhacs-eng-image }}-arm64
podman manifest inspect ${{ needs.vars.outputs.rhacs-eng-image }}
podman manifest push ${{ needs.vars.outputs.rhacs-eng-image }}
container-build-otel:
uses: ./.github/workflows/container-build.yml
secrets: inherit
with:
tag-suffix: '-otel'
make-target: 'image-otel'

unit-tests:
uses: ./.github/workflows/unit-tests.yml
secrets: inherit

integration-tests:
needs:
- vars
- manifest-stackrox-io
- manifest-rhacs-eng
- container-build
uses: ./.github/workflows/integration-tests.yml
with:
tag: ${{ needs.vars.outputs.tag }}
tag: ${{ needs.container-build.outputs.tag }}
vms: '["fedora-coreos", "fcarm", "rhel", "rhel-arm64", "rhcos", "rhcos-arm64"]'
secrets: inherit

integration-tests-otel:
needs:
- container-build-otel
uses: ./.github/workflows/integration-tests.yml
with:
tag: ${{ needs.container-build-otel.outputs.tag }}
job-tag: otel
vms: '["fedora-coreos"]'
output-type: otlp
secrets: inherit

performance-tests:
if: github.event_name == 'schedule'
needs:
- vars
- manifest-stackrox-io
- manifest-rhacs-eng
- integration-tests
uses: ./.github/workflows/performance-tests.yml
- container-build
uses: ./.github/workflows/integration-tests.yml
with:
tag: ${{ needs.vars.outputs.tag }}
tag: ${{ needs.container-build.outputs.tag }}
vms: '["fedora-coreos", "fcarm", "rhel", "rhel-arm64", "rhcos", "rhcos-arm64"]'
secrets: inherit
125 changes: 125 additions & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Build container
on:
workflow_call:
inputs:
tag-suffix:
required: false
default: ''
type: string
make-target:
required: false
default: 'image'
type: string
outputs:
tag:
value: ${{ jobs.vars.outputs.tag }}

jobs:
vars:
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.vars.outputs.tag }}
stackrox-io-image: ${{ steps.vars.outputs.stackrox-io-image }}
rhacs-eng-image: ${{ steps.vars.outputs.rhacs-eng-image }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- id: vars
run: |
cat << EOF >> "$GITHUB_OUTPUT"
tag=$(make tag)${{ inputs.tag-suffix }}
stackrox-io-image=$(make image-name)${{ inputs.tag-suffix }}
rhacs-eng-image=$(FACT_REGISTRY="quay.io/rhacs-eng/fact" make image-name)${{ inputs.tag-suffix }}
EOF

container:
needs:
- vars
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
env:
FACT_TAG: ${{ needs.vars.outputs.tag }}-${{ matrix.arch }}
FACT_VERSION: ${{ needs.vars.outputs.tag }}
STACKROX_IO_IMAGE: ${{ needs.vars.outputs.stackrox-io-image }}-${{ matrix.arch }}
RHACS_ENG_IMAGE: ${{ needs.vars.outputs.rhacs-eng-image }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build image
run: DOCKER=podman make ${{ inputs.make-target }}

- name: Login to quay.io/stackrox-io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- run: podman push "${STACKROX_IO_IMAGE}"

- name: Login to quay.io/rhacs-eng
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}

- name: Tag and push to rhacs-eng
run: |
podman tag "${STACKROX_IO_IMAGE}" "${RHACS_ENG_IMAGE}"
podman push "${RHACS_ENG_IMAGE}"

manifest-stackrox-io:
runs-on: ubuntu-24.04
needs:
- container
- vars
env:
ARCHS: amd64 arm64
steps:
- uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- name: Create multiarch manifest
run: |
podman manifest create ${{ needs.vars.outputs.stackrox-io-image }} \
${{ needs.vars.outputs.stackrox-io-image }}-amd64 \
${{ needs.vars.outputs.stackrox-io-image }}-arm64
podman manifest inspect ${{ needs.vars.outputs.stackrox-io-image }}
podman manifest push ${{ needs.vars.outputs.stackrox-io-image }}

manifest-rhacs-eng:
runs-on: ubuntu-24.04
needs:
- container
- vars
env:
ARCHS: amd64 arm64
steps:
- uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}

- name: Create multiarch manifest
run: |
podman manifest create ${{ needs.vars.outputs.rhacs-eng-image }} \
${{ needs.vars.outputs.rhacs-eng-image }}-amd64 \
${{ needs.vars.outputs.rhacs-eng-image }}-arm64
podman manifest inspect ${{ needs.vars.outputs.rhacs-eng-image }}
podman manifest push ${{ needs.vars.outputs.rhacs-eng-image }}

23 changes: 14 additions & 9 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ on:
job-tag:
description: Additional tag to prevent collision on GCP VM naming
type: string
default: ''
default: 'main'
vms:
description: JSON encoded list of vms to run tests on
type: string
required: true
output-type:
description: The output type to be used in the tests
type: string
required: false
default: grpc

jobs:
integration-tests:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
vm:
- fedora-coreos
- fcarm
- rhel
- rhel-arm64
- rhcos
- rhcos-arm64
vm: ${{ fromJson(inputs.vms) }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -73,6 +76,7 @@ jobs:
FACT_VERSION: ${{ inputs.version }}
FACT_REGISTRY: ${{ inputs.registry }}
FACT_TAG: ${{ inputs.tag }}
OUTPUT_TYPE: ${{ inputs.output-type }}
run: |
FACT_IMAGE_NAME="$(make -sC "${GITHUB_WORKSPACE}/fact" image-name)"
cat << EOF > vars.yml
Expand All @@ -81,6 +85,7 @@ jobs:
fact:
image: ${FACT_IMAGE_NAME}
version: ${FACT_VERSION}
output_type: ${OUTPUT_TYPE}
quay:
username: ${{ secrets.QUAY_RHACS_ENG_RO_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RO_PASSWORD }}
Expand Down Expand Up @@ -147,7 +152,7 @@ jobs:
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.vm }}-test-logs
name: ${{ matrix.vm }}-${{ inputs.job-tag }}-test-logs
path: |
/tmp/fact/tests/logs
/tmp/fact/tests/*-results.xml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/konflux-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ jobs:
registry: quay.io/rhacs-eng/release-fact
tag: ${{ needs.init.outputs.fact-tag }}
job-tag: konf
vms: '["fedora-coreos", "fcarm", "rhel", "rhel-arm64", "rhcos", "rhcos-arm64"]'
secrets: inherit
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ image:
-f Containerfile \
--build-arg FACT_VERSION=$(FACT_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg CARGO_ARGS="$(CARGO_ARGS)" \
-t $(FACT_IMAGE_NAME) \
$(CURDIR)

image-otel:
$(DOCKER) build \
-f Containerfile \
--build-arg FACT_VERSION=$(FACT_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg CARGO_ARGS="--features otel" \
-t $(FACT_IMAGE_NAME)-otel \
$(CURDIR)
image-otel: CARGO_ARGS = --features otel
image-otel: image

licenses:THIRD_PARTY_LICENSES.html

Expand Down
Loading
Loading