Skip to content

Commit

Permalink
chore: updated README with composite action section.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Feb 15, 2024
1 parent 12e1ea9 commit 93fb86c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 93fb86c

Please sign in to comment.