Skip to content

Commit 616c7a8

Browse files
committed
feat: Added test-step to build+scan docker image
1 parent ca0a0e1 commit 616c7a8

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

.github/workflows/test.yaml

Lines changed: 42 additions & 4 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:
@@ -57,7 +57,7 @@ jobs:
5757
uses: actions/checkout@v4
5858
with:
5959
ref: ${{ github.sha }} # required for better experience using pre-releases
60-
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
60+
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
6161

6262
- name: Extract current version
6363
id: pyproject_version
@@ -78,7 +78,7 @@ jobs:
7878
env:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8080
DEFAULT_BUMP: "patch"
81-
TAG_CONTEXT: 'repo'
81+
TAG_CONTEXT: "repo"
8282
WITH_V: true
8383
DRY_RUN: true
8484

@@ -99,3 +99,41 @@ jobs:
9999
New Tag version: **${{ steps.semantic_release.outputs.tag }}**
100100
The version is up-to-date." >> $GITHUB_STEP_SUMMARY
101101
fi
102+
103+
test_build:
104+
name: Test Build
105+
runs-on: ubuntu-latest
106+
needs: test
107+
permissions:
108+
contents: read # required for actions/checkout
109+
steps:
110+
- name: Check out the repo
111+
uses: actions/checkout@v4
112+
with:
113+
ref: ${{ github.sha }} # required for better experience using pre-releases
114+
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
115+
116+
- name: Log in to GitHub Container Registry
117+
uses: docker/login-action@v3
118+
with:
119+
registry: ghcr.io
120+
username: ${{ github.actor }}
121+
password: ${{ secrets.GITHUB_TOKEN }}
122+
123+
- name: Build Docker image
124+
id: build-to-test
125+
uses: docker/build-push-action@v5
126+
with:
127+
context: .
128+
load: true
129+
push: false
130+
tags: |
131+
ghcr.io/sysdiglabs/sysdig-mcp-server:test
132+
133+
- name: Scan Docker image
134+
uses: sysdiglabs/scan-action@v6
135+
with:
136+
image-tag: ghcr.io/sysdiglabs/sysdig-mcp-server:test
137+
sysdig-secure-token: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
138+
stop-on-failed-policy-eval: true
139+
stop-on-processing-error: true

0 commit comments

Comments
 (0)