mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-21 19:44:57 +00:00
91 lines
3.3 KiB
YAML
91 lines
3.3 KiB
YAML
# This is a reusable workflow used by master and release CI
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
arch:
|
|
description: x86_64 or aarch64
|
|
required: true
|
|
type: string
|
|
static:
|
|
description: Falco packages use a static build
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
version:
|
|
description: The Falco version to use when testing packages
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
test-packages:
|
|
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
|
|
runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || 'ubuntu-latest' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: 'true'
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '>=1.17.0'
|
|
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: falco-${{ inputs.version }}${{ inputs.static && '-static' || '' }}-${{ inputs.arch }}.tar.gz
|
|
|
|
- name: Install Falco package
|
|
run: |
|
|
ls falco-*.tar.gz
|
|
tar -xvf $(ls falco-*.tar.gz)
|
|
cd falco-${{ inputs.version }}-${{ inputs.arch }}
|
|
sudo cp -r * /
|
|
|
|
# x86_64 job run on ubuntu-22.04 and here we can install kernel-headers
|
|
- name: Install dependencies for falco-driver-loader tests on x86
|
|
if: ${{ inputs.arch == 'x86_64' }}
|
|
run: |
|
|
sudo apt update -y
|
|
sudo apt install -y --no-install-recommends build-essential clang make llvm gcc dkms linux-headers-$(uname -r)
|
|
|
|
- name: Install go-junit-report
|
|
run: |
|
|
pushd submodules/falcosecurity-testing
|
|
go install github.com/jstemmer/go-junit-report/v2@latest
|
|
popd
|
|
|
|
- name: Generate regression test files
|
|
run: |
|
|
pushd submodules/falcosecurity-testing
|
|
go generate ./...
|
|
popd
|
|
|
|
# Right now we are not able to install kernel-headers on our ARM64 self-hosted runner.
|
|
# For this reason, we disable the falco-driver-loader tests, which require kernel headers on the host.
|
|
- name: Run regression tests
|
|
env:
|
|
# fixme(leogr): this is a workaround for https://github.com/falcosecurity/falco/issues/2784
|
|
HOST_ROOT: ""
|
|
run: |
|
|
pushd submodules/falcosecurity-testing
|
|
./build/falco.test -falco-static=${{ inputs.static && 'true' || 'false' }} -test.timeout=90s -test.v >> ./report.txt 2>&1 || true
|
|
if ${{ inputs.static && 'false' || 'true' }}; then
|
|
./build/falcoctl.test -test.timeout=90s -test.v >> ./report.txt 2>&1 || true
|
|
./build/k8saudit.test -test.timeout=90s -test.v >> ./report.txt 2>&1 || true
|
|
if ${{ inputs.arch == 'x86_64' && 'true' || 'false' }}; then
|
|
sudo ./build/falco-driver-loader.test -test.timeout=90s -test.v >> ./report.txt 2>&1 || true
|
|
fi
|
|
fi
|
|
cat ./report.txt | go-junit-report -set-exit-code > report.xml
|
|
popd
|
|
|
|
- name: Test Summary
|
|
if: always() # run this even if previous step fails
|
|
uses: test-summary/action@v2
|
|
with:
|
|
paths: "submodules/falcosecurity-testing/report.xml"
|
|
show: "fail"
|