Skip to content

Commit cc5821f

Browse files
committed
updating yamls
1 parent 5820c2f commit cc5821f

File tree

6 files changed

+75
-68
lines changed

6 files changed

+75
-68
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
name: Build Docker Image
1+
name: Build Python Project
22
on:
33
workflow_call:
44

55

66
jobs:
7-
# Build Docker Image
87
build:
9-
name: Build Docker Image
8+
name: Install dependencies and build project
109
runs-on: ubuntu-latest
11-
1210
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Build Docker Image
17-
run: |
18-
docker build -t awesome-fastapi:${{ github.sha }} .
19-
11+
- uses: actions/checkout@v4
12+
- name: Install dependencies
13+
run: |
14+
pip install -r requirements.txt
15+
python -m pip install --upgrade pip
16+
- name: Build Project
17+
run: |
18+
python -m build

.github/workflows/main.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# name: Main Workflow
2-
# on:
3-
# push:
4-
# branches:
5-
# - main
6-
# workflow_dispatch:
1+
name: Main Workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
77

8-
# jobs:
9-
# # Add Publisher Job here
10-
# publish:
11-
# uses: ./.github/workflows/publish.yml
12-
# secrets: inherit
13-
8+
jobs:
9+
# Add Publisher Job here
10+
build:
11+
uses: ./.github/workflows/build.yml
12+
secrets: inherit
13+
syntax:
14+
uses: ./.github/workflows/syntax.yml
15+
secrets: inherit
16+
scan:
17+
uses: ./.github/workflows/scan.yml
18+
secrets: inherit

.github/workflows/pr.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: PR Workflow
2-
on:
3-
pull_request:
4-
types:
5-
- opened
6-
- edited
7-
- synchronize
8-
- reopened
1+
# name: PR Workflow
2+
# on:
3+
# pull_request:
4+
# types:
5+
# - opened
6+
# - edited
7+
# - synchronize
8+
# - reopened
99

10-
permissions:
11-
contents: read
12-
security-events: write
13-
actions: read
10+
# permissions:
11+
# contents: read
12+
# security-events: write
13+
# actions: read
1414

1515

16-
jobs:
16+
# jobs:

.github/workflows/push-image.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/scan.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Security Scanning
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
generate-sbom:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
24+
- name: Generate SBOM with Trivy
25+
run: |
26+
docker run --rm -v $(pwd):/app aquasec/trivy:latest fs --format cyclonedx --output /app/sbom.json /app
27+
28+
- name: Upload SBOM artifact
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: sbom
32+
path: sbom.json

.github/workflows/syntax.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linting and Formating Checks
1+
name: Linting & Formating Checks
22
on:
33
workflow_call:
44

@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
- name: 'Setup Python ${{ matrix.python-version}}'
17-
uses: actions/setup-python@v3
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: '${{ matrix.python-version}}'
2020

@@ -36,7 +36,7 @@ jobs:
3636
steps:
3737
- uses: actions/checkout@v4
3838
- name: 'Setup Python ${{ matrix.python-version}}'
39-
uses: actions/setup-python@v3
39+
uses: actions/setup-python@v5
4040
with:
4141
python-version: '${{ matrix.python-version}}'
4242

0 commit comments

Comments
 (0)