Skip to content

Commit d9df986

Browse files
committed
split gh jobs into seperate yml files + updated readme
1 parent 381a21c commit d9df986

File tree

6 files changed

+123
-88
lines changed

6 files changed

+123
-88
lines changed

.github/workflows/docker.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docker Build & Scan
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
docker:
12+
name: Docker Build & Scan
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
- name: Build Docker image
19+
uses: docker/build-push-action@v4
20+
with:
21+
context: ./backend
22+
push: false
23+
load: true
24+
tags: integr8scode:test
25+
cache-from: type=gha
26+
cache-to: type=gha,mode=max
27+
- name: Run Trivy vulnerability scanner
28+
uses: aquasecurity/trivy-action@master
29+
with:
30+
image-ref: 'integr8scode:test'
31+
format: 'table'
32+
exit-code: '1'
33+
ignore-unfixed: true
34+
severity: 'CRITICAL,HIGH'
35+
timeout: '5m0s'

.github/workflows/mypy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: MyPy Type Checking
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
mypy:
12+
name: Mypy Type Checking
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install mypy
24+
pip install -r backend/requirements.txt
25+
pip install -r backend/requirements-dev.txt
26+
- name: Run mypy
27+
run: mypy --config-file backend/pyproject.toml backend/

.github/workflows/ruff.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Ruff Linting
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
ruff:
12+
name: Ruff Linting
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install ruff
24+
- name: Run ruff
25+
run: ruff check backend/ --config backend/pyproject.toml

.github/workflows/security.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Security Scanning
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
security-scan:
12+
name: Security Scanning
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install bandit safety
24+
- name: Run bandit
25+
run: bandit -r backend/ -x backend/tests/ -ll
Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Backend Checks and Tests
1+
name: Integration Tests
22

33
on:
44
push:
@@ -8,86 +8,9 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
ruff:
12-
name: Ruff Linting
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- name: Set up Python
17-
uses: actions/setup-python@v4
18-
with:
19-
python-version: '3.9'
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install ruff
24-
- name: Run ruff
25-
run: ruff check backend/ --config backend/pyproject.toml
26-
27-
mypy:
28-
name: Mypy Type Checking
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v4
32-
- name: Set up Python
33-
uses: actions/setup-python@v4
34-
with:
35-
python-version: '3.9'
36-
- name: Install dependencies
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install mypy
40-
pip install -r backend/requirements.txt
41-
pip install -r backend/requirements-dev.txt
42-
- name: Run mypy
43-
run: mypy --config-file backend/pyproject.toml backend/
44-
45-
security-scan:
46-
name: Security Scanning
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v4
50-
- name: Set up Python
51-
uses: actions/setup-python@v4
52-
with:
53-
python-version: '3.9'
54-
- name: Install dependencies
55-
run: |
56-
python -m pip install --upgrade pip
57-
pip install bandit safety
58-
- name: Run bandit
59-
run: bandit -r backend/ -x backend/tests/ -ll
60-
61-
docker:
62-
name: Docker Build & Scan
63-
runs-on: ubuntu-latest
64-
steps:
65-
- uses: actions/checkout@v4
66-
- name: Set up Docker Buildx
67-
uses: docker/setup-buildx-action@v2
68-
- name: Build Docker image
69-
uses: docker/build-push-action@v4
70-
with:
71-
context: ./backend
72-
push: false
73-
load: true
74-
tags: integr8scode:test
75-
cache-from: type=gha
76-
cache-to: type=gha,mode=max
77-
- name: Run Trivy vulnerability scanner
78-
uses: aquasecurity/trivy-action@master
79-
with:
80-
image-ref: 'integr8scode:test'
81-
format: 'table'
82-
exit-code: '1'
83-
ignore-unfixed: true
84-
severity: 'CRITICAL,HIGH'
85-
timeout: '5m0s'
86-
8711
tests:
8812
name: Backend Tests
8913
runs-on: ubuntu-latest
90-
needs: [ruff, mypy, security-scan, docker]
9114
steps:
9215
- uses: actions/checkout@v4
9316

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
</p>
55

66
<p align="center">
7-
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/backend-checks.yml">
8-
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/backend-checks.yml?branch=main&label=mypy&logo=python&logoColor=white" alt="Mypy Status" />
7+
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/ruff.yml">
8+
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/ruff.yml?branch=main&label=ruff&logo=python&logoColor=white" alt="Ruff Status" />
99
</a>
10-
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/backend-checks.yml">
11-
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/backend-checks.yml?branch=main&label=ruff&logo=python&logoColor=white" alt="Ruff Status" />
10+
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/mypy.yml">
11+
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/mypy.yml?branch=main&label=mypy&logo=python&logoColor=white" alt="Mypy Status" />
1212
</a>
13-
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/backend-checks.yml">
14-
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/backend-checks.yml?branch=main&label=security&logo=shieldsdotio&logoColor=white" alt="Security Scan Status" />
13+
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/security.yml">
14+
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/security.yml?branch=main&label=security&logo=shieldsdotio&logoColor=white" alt="Security Scan Status" />
1515
</a>
16-
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/backend-checks.yml">
17-
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/backend-checks.yml?branch=main&label=docker&logo=docker&logoColor=white" alt="Docker Scan Status" />
16+
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/docker.yml">
17+
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/docker.yml?branch=main&label=docker&logo=docker&logoColor=white" alt="Docker Scan Status" />
1818
</a>
19-
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/backend-checks.yml">
20-
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/backend-checks.yml?branch=main&label=tests&logo=pytest" alt="Tests Status" />
19+
<a href="https://github.com/HardMax71/Integr8sCode/actions/workflows/tests.yml">
20+
<img src="https://img.shields.io/github/actions/workflow/status/HardMax71/Integr8sCode/tests.yml?branch=main&label=tests&logo=pytest" alt="Tests Status" />
2121
</a>
2222
</p>
2323
<p align="center">

0 commit comments

Comments
 (0)