@@ -2,7 +2,7 @@ name: CI Pipeline
22
33on :
44 push :
5- branches : [ main, develop ]
5+ branches : [ main, develop, 'feature/CI-CD-improve' ]
66 pull_request :
77 branches : [ main ]
88
@@ -16,18 +16,18 @@ jobs:
1616
1717 steps :
1818 - name : Checkout code
19- uses : actions/checkout@v3
19+ uses : actions/checkout@v4
2020
2121 - name : Set up Python
22- uses : actions/setup-python@v4
22+ uses : actions/setup-python@v5
2323 with :
2424 python-version : ${{ env.PYTHON_VERSION }}
2525 cache : ' pip'
2626
2727 - name : Install dependencies
2828 run : |
2929 python -m pip install --upgrade pip
30- pip install black flake8 mypy isort
30+ pip install black flake8 mypy isort types-PyYAML
3131 pip install -r requirements.txt
3232
3333 - name : Run Black (code formatting)
@@ -63,10 +63,10 @@ jobs:
6363
6464 steps :
6565 - name : Checkout code
66- uses : actions/checkout@v3
66+ uses : actions/checkout@v4
6767
6868 - name : Set up Python
69- uses : actions/setup-python@v4
69+ uses : actions/setup-python@v5
7070 with :
7171 python-version : ${{ env.PYTHON_VERSION }}
7272 cache : ' pip'
@@ -94,15 +94,16 @@ jobs:
9494 DATABASE_URL : postgresql://postgres:postgres@localhost:5432/test_db
9595
9696 - name : Upload coverage to Codecov
97- uses : codecov/codecov-action@v3
97+ uses : codecov/codecov-action@v4
9898 with :
9999 file : ./coverage.xml
100100 flags : unittests
101101 name : codecov-umbrella
102102 fail_ci_if_error : true
103+ token : ${{ secrets.CODECOV_TOKEN }}
103104
104105 - name : Upload coverage report as artifact
105- uses : actions/upload-artifact@v3
106+ uses : actions/upload-artifact@v4
106107 with :
107108 name : coverage-report
108109 path : htmlcov/
@@ -114,10 +115,20 @@ jobs:
114115
115116 steps :
116117 - name : Checkout code
117- uses : actions/checkout@v3
118+ uses : actions/checkout@v4
119+
120+ # 👇 РУЧНЕ ОЧИЩЕННЯ ДИСКА (ПРАЦЮЄ ЗАВЖДИ) 👇
121+ - name : Free Disk Space (Manual)
122+ run : |
123+ sudo rm -rf /usr/share/dotnet
124+ sudo rm -rf /usr/local/lib/android
125+ sudo rm -rf /opt/ghc
126+ sudo rm -rf /opt/hostedtoolcache/CodeQL
127+ sudo docker image prune --all --force
128+ # 👆 КІНЕЦЬ БЛОКУ 👆
118129
119130 - name : Set up Docker Buildx
120- uses : docker/setup-buildx-action@v2
131+ uses : docker/setup-buildx-action@v3
121132
122133 - name : Build Airflow image
123134 run : |
@@ -144,10 +155,14 @@ jobs:
144155 name : Security Scanning
145156 runs-on : ubuntu-latest
146157 needs : lint
158+ permissions :
159+ contents : read
160+ security-events : write
161+ actions : read
147162
148163 steps :
149164 - name : Checkout code
150- uses : actions/checkout@v3
165+ uses : actions/checkout@v4
151166
152167 - name : Run Trivy vulnerability scanner
153168 uses : aquasecurity/trivy-action@master
@@ -158,7 +173,7 @@ jobs:
158173 output : ' trivy-results.sarif'
159174
160175 - name : Upload Trivy results to GitHub Security
161- uses : github/codeql-action/upload-sarif@v2
176+ uses : github/codeql-action/upload-sarif@v3
162177 with :
163178 sarif_file : ' trivy-results.sarif'
164179
@@ -168,7 +183,7 @@ jobs:
168183 bandit -r src/ -f json -o bandit-report.json || true
169184
170185 - name : Upload Bandit report
171- uses : actions/upload-artifact@v3
186+ uses : actions/upload-artifact@v4
172187 with :
173188 name : bandit-security-report
174189 path : bandit-report.json
0 commit comments