Skip to content

Commit e92e1c0

Browse files
committed
fix: Move test_image to separate workflow
1 parent 6a0b582 commit e92e1c0

File tree

2 files changed

+57
-39
lines changed

2 files changed

+57
-39
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
- tests/**
1111
- tools/**
1212
- utils/**
13-
- .github/workflows/**
1413
workflow_call:
1514
workflow_dispatch:
1615

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

.github/workflows/test_image.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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.KUBELAB_SECURE_API_TOKEN }}
56+
stop-on-failed-policy-eval: true
57+
stop-on-processing-error: true

0 commit comments

Comments
 (0)