-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (86 loc) · 3.03 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Python Lints / Checks
on:
pull_request:
push:
branches:
- main
jobs:
mypy_lint:
name: Lint with Mypy and Ruff
runs-on: ubuntu-24.04
container:
image: python:3.12-bookworm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: prepare environment
run: |
apt-get update
apt-get install cmake --no-install-recommends -y
pip install pipenv -U --quiet
pipenv install --dev
- name: run lint
run: |
pipenv run mypy
pipenv run ruff-ci github
tests:
name: Test with pytest
runs-on: ubuntu-24.04
container:
image: python:3.12-bookworm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: prepare environment
run: |
apt-get update
apt-get install ffmpeg cmake --no-install-recommends -y
pip install pipenv -U --quiet
pipenv install --dev
- name: run tests
run: |
pipenv run test
sonarqube_checks:
name: SonarQube Checks
runs-on: ubuntu-24.04
needs:
- mypy_lint
- tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: prepare environment
run: |
sudo apt-get update
sudo apt-get install python3.12 ffmpeg --no-install-recommends -y
pip install pipenv -U --quiet
pipenv install --dev
- name: run coverage report
run: |
pipenv run coverage
- name: generate requirements.txt
run: |
pipenv requirements --dev > requirements.txt
- name: Dependency check
uses: dependency-check/Dependency-Check_Action@main
id: Dependency_check
with:
project: "Video Language Detection"
path: "."
format: HTML
out: "reports"
args: >
--failOnCVSS 7
--enableRetired
--enableExperimental
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}