Skip to content

Commit 63edbad

Browse files
alecrontembleking
andauthored
feat: Added test-step to build+scan docker image (#11)
# Add vuln-scan to the test steps ## Changes A new check has been added to the `test` workflow that builds and scans the docker image --------- Co-authored-by: Fede Barcelona <[email protected]>
1 parent 91b46f5 commit 63edbad

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ on:
66
paths:
77
- pyproject.toml
88
- Dockerfile
9-
- '*.py'
9+
- "*.py"
1010
- tests/**
1111
- tools/**
1212
- utils/**
1313
workflow_call:
1414
workflow_dispatch:
1515

1616
concurrency:
17-
group: 'tests-${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
17+
group: "tests-${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
1818
cancel-in-progress: true
1919

2020
jobs:

.github/workflows/test_image.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Test Image Build
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- pyproject.toml
8+
- Dockerfile
9+
- "*.py"
10+
- tests/**
11+
- tools/**
12+
- utils/**
13+
- .github/workflows/**
14+
workflow_call:
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: "test-image-${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test_build:
23+
name: Test Build
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read # required for actions/checkout
27+
steps:
28+
- name: Check out the repo
29+
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ github.sha }} # required for better experience using pre-releases
32+
fetch-depth: "0" # Required due to the way Git works, without it this action won't be able to find any or the correct tags
33+
34+
- name: Log in to GitHub Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Build Docker image
42+
id: build-to-test
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: .
46+
load: true
47+
push: false
48+
tags: |
49+
ghcr.io/sysdiglabs/sysdig-mcp-server:test
50+
51+
- name: Scan Docker image
52+
uses: sysdiglabs/scan-action@v6
53+
with:
54+
image-tag: ghcr.io/sysdiglabs/sysdig-mcp-server:test
55+
sysdig-secure-token: ${{ secrets.SECURE_ENV_MON_API_KEY }}
56+
sysdig-secure-url: ${{ secrets.SECURE_ENV_MON_ENDPOINT }}
57+
stop-on-failed-policy-eval: true
58+
stop-on-processing-error: true

0 commit comments

Comments
 (0)