-
Notifications
You must be signed in to change notification settings - Fork 11
79 lines (71 loc) · 2.49 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# Copyright (C) 2023 The Falco Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Test on Latest Dev Falco
on:
workflow_dispatch:
inputs:
version:
description: Falco Version
default: master
required: true
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build:
name: Run Tests on falcosecurity/falco image
runs-on: ubuntu-latest
container:
image: falcosecurity/falco:${{ github.event.inputs.version || 'master' }}
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ">=1.17.0"
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install needed artifacts using falcoctl
run: |
mkdir -p /usr/share/falco/plugins
falcoctl artifact install k8saudit-rules
falcoctl artifact install cloudtrail-rules
# note: this converts the output of go test into a junit-compatible,
# which can later be processed by test-summary/action to upload
# a Markdown report on the GitHub Actions workflow.
- name: Install go-junit-report
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
- name: Generate test files
run: |
go generate ./...
- name: Run tests
env:
# fixme(leogr): this is a workaround for https://github.com/falcosecurity/falco/issues/2784
HOST_ROOT: ""
run: |
./build/falco.test -test.timeout=90s -test.v >> ./report.txt 2>&1 || true
./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
cat ./report.txt | go-junit-report -set-exit-code > report.xml
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "report.xml"
show: "all"
if: always() # note: upload the report even if tests fail