diff --git a/README.md b/README.md index f1ba7b2..7a49434 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,36 @@ build/falco.test -test.run 'TestFalco_Legacy_WriteBinaryDir' To check all other options use the `--help` flag. +## Usage in CI + +To better suit the CI usage, a [Github composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) has been developed. Therefore, running Falco tests in your Github workflow is as easy as adding this step: +``` +- name: Run tests + uses: falcosecurity/testing@main + with: + # Whether to test Falco. + # Default: 'true'. + test-falco: 'true' + # Whether to test Falcoctl. + # Default: 'false'. + test-falcoctl: 'true' + # Whether to test k8saudit. + # Default: 'false'. + test-k8saudit: 'true' + # Whether to test drivers. + # Default: 'false'. + test-drivers: 'true' + # Whether to run Falco in static mode in tests + # If enabled, only Falco tests will be enabled, + # all the others will be forcefully skipped. + # Default: 'false'. + static: 'false' + # Whether to upload all tests in action-summary. + # Default: 'false'. + show-all: 'true' +``` + + ## Keep tests updated with the latest Falco version Some of these tests might become incompatible with a new Falco version, for example after a fix an old scap-file could trigger more rules than the ones expected or maybe the rule is no more triggered for a valid reason. diff --git a/action.yml b/action.yml index 90b5446..681e6ea 100644 --- a/action.yml +++ b/action.yml @@ -14,8 +14,8 @@ inputs: description: 'Whether to run k8saudit tests. Default disabled.' required: false default: 'false' - test-driver: - description: 'Whether to run driver tests. Default disabled.' + test-drivers: + description: 'Whether to run drivers tests. Default disabled.' required: false default: 'false' static: @@ -90,7 +90,7 @@ runs: if ${{ inputs.test-k8saudit && 'true' || 'false' }}; then ./build/k8saudit.test -test.timeout=90s -test.v >> ./report.txt 2>&1 || true fi - if ${{ inputs.test-driver && 'true' || 'false' }}; then + if ${{ inputs.test-drivers && 'true' || 'false' }}; then sudo ./build/falco-driver-loader.test -test.timeout=90s -test.v >> ./report.txt 2>&1 || true fi fi