Skip to content

Commit 2723c23

Browse files
authored
Adding reusable workflows and actions for use across FMOS build processes (zephyrproject-rtos#9)
* actions: adding trivy-cve-scan * workflows: adding fmos-ci-self-test.yml
1 parent 8cddc19 commit 2723c23

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: fmos-ci-self-test standard workflow
2+
on:
3+
workflow_call:
4+
inputs:
5+
container:
6+
required: true
7+
type: string
8+
runner:
9+
required: true
10+
type: string
11+
secrets:
12+
token:
13+
required: true
14+
15+
jobs:
16+
fmos-ci-self-test:
17+
runs-on: ${{ inputs.runner }}
18+
defaults:
19+
run:
20+
shell: bash
21+
container:
22+
image: ${{ inputs.container }}
23+
options: -v/opt/toolchains:/opt/toolchains
24+
strategy:
25+
matrix:
26+
batch: [1, 2, 3]
27+
batch_total: [ 3 ]
28+
steps:
29+
- name: checkout zephyr ci-self-test tag
30+
uses: actions/checkout@v2
31+
with:
32+
path: 'zephyrproject/zephyr'
33+
repository: 'intel-innersource/os.rtos.zephyr.zephyr.git'
34+
ref: '1rtos-ci-self-test'
35+
token: ${{ secrets.token }}
36+
- name: run 1rtos-ci twister wrapper with batch options
37+
run: /opt/1rtos/container-api.sh 1rtos-ci $GITHUB_WORKSPACE ${{ matrix.batch }} ${{ matrix.batch_total }}

actions/trivy-cve-scan/action.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'trivy-cve-scan'
2+
description: 'executes trivy CVE scan on selected container url'
3+
inputs:
4+
container-url:
5+
description: 'url pointint to container to scan'
6+
required: true
7+
cve-level:
8+
description: 'label for this instance'
9+
required: true
10+
default: 'CRITICAL,HIGH'
11+
exit-code:
12+
description: 'testnet hostname to target for install'
13+
required: true
14+
default: '1'
15+
dockerio-user:
16+
description: 'username for docker.io, required to login for pull operation'
17+
required: true
18+
dockerio-pass:
19+
description: 'password for docker.io, required to login for pull operation'
20+
required: true
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: execute trivy scan on external container
26+
run: |
27+
docker login -u ${{ inputs.dockerio-user }} -p ${{ inputs.dockerio-pass }} && \
28+
docker run --rm -e http_proxy -e https_proxy -v/var/run/docker.sock:/var/run/docker.sock aquasec/trivy:latest i --security-checks vuln,config --exit-code ${{ inputs.exit-code }} --ignore-unfixed --severity ${{ inputs.cve-level }} ${{ inputs.container-url }} && \
29+
docker logout
30+
shell: bash

src/actions/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)