Skip to content
75 changes: 61 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ concurrency:

jobs:
basic:
runs-on: ubuntu-24.04
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
strategy:
fail-fast: false
matrix:
args:
- build --release
- clippy -- -D warnings
- test
arch:
- amd64
- arm64
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -57,40 +60,84 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ steps.args.outputs.args }}-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.args.outputs.args }}-${{ hashFiles('**/Cargo.lock') }}
- run: cargo ${{ matrix.args }}

container:
vars:
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.vars.outputs.tag }}
image-name: ${{ steps.vars.outputs.image-name }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- id: vars
run: |
cat << EOF >> "$GITHUB_OUTPUT"
tag=$(make tag)
image-name=$(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 }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- run: 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: docker push "$(make image-name)"

tag:
manifest:
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.tag.outputs.tag }}
needs:
- container
- vars
env:
ARCHS: amd64 arm64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- id: tag
run: echo "tag=$(make tag)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: stackrox/collector
path: collector
ref: master

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

- uses: ./collector/.github/actions/create-multiarch-manifest
with:
base-image: ${{ needs.vars.outputs.image-name }}
archs: ${{ env.ARCHS }}

integration-tests:
needs:
- container
- tag
- vars
- manifest
uses: ./.github/workflows/integration-tests.yml
with:
tag: ${{ needs.tag.outputs.tag }}
tag: ${{ needs.vars.outputs.tag }}
secrets: inherit
16 changes: 14 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@ on:
type: string
default: ''

# TODO: Remove once Konflux builds have been
# modified to support Arm
vm_list:
description: JSON list of VMs to test on
default: '["fedora-coreos","fcarm"]'
type: string

jobs:
integration-tests:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
vm: "${{ fromJSON(inputs.vm_list) }}"

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -53,7 +65,7 @@ jobs:
ppc64le-key: ${{ secrets.IBM_CLOUD_POWER_API_KEY }}
redhat-username: ${{ secrets.REDHAT_USERNAME }}
redhat-password: ${{ secrets.REDHAT_PASSWORD }}
vm-type: fedora-coreos
vm-type: ${{ matrix.vm }}
job-tag: ${{ inputs.job-tag }}
workspace: ${{ github.workspace }}/collector

Expand Down Expand Up @@ -110,7 +122,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs
name: ${{ matrix.vm }}-test-logs
path: |
${{ github.workspace }}/fact/tests/logs
${{ github.workspace }}/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/fact
tag: ${{ needs.init.outputs.fact-tag }}
job-tag: konf
vm_list: '["fedora-coreos"]'
secrets: inherit
2 changes: 2 additions & 0 deletions ansible/group_vars/platform_fcarm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
ansible_user: core
2 changes: 1 addition & 1 deletion ansible/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Run integration tests
hosts: "job_id_{{ job_id }}"
hosts: "platform_*:&job_id_{{ job_id }}"
environment:
FACT_IMAGE_NAME: "{{ fact.image | default(None) }}"

Expand Down
Loading
Loading