-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (139 loc) · 4.29 KB
/
main.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on: push
env:
PYTHON_VERSION: 3.12
jobs:
fossa:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Print Python version
run: python -V
- name: Checkout
uses: actions/checkout@v4
- name: Load pip cache
uses: actions/cache@v4
with:
path: .pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-
pip-
- name: Install apt requirements
run: sudo apt-get install gcc libssl-dev python3-dev swig
- name: Install requirements
run: |
pip --cache-dir=.pip install --upgrade pip
pip --cache-dir=.pip install -r requirements.txt
- name: Install FOSSA
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
- name: Run FOSSA
run: fossa analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
lint:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Print Python version
run: python -V
- name: Checkout
uses: actions/checkout@v4
- name: Load pip cache
uses: actions/cache@v4
with:
path: .pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-
pip-
- name: Install apt requirements
run: sudo apt-get install gcc libssl-dev python3-dev swig
- name: Install requirements
run: |
pip --cache-dir=.pip install --upgrade pip
pip --cache-dir=.pip install pylint
pip --cache-dir=.pip install -r requirements.txt
- name: Run Pylint
run: pylint startup tests f3.py kernel_remover.py maintenance.py modem.py misc_misc_utils.py 2>&1 | tee pylint.txt
working-directory: ${{ github.workspace }}
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: Lint
path: |
${{ github.workspace }}/pylint.txt
if-no-files-found: error
sast:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: AppThreat/sast-scan-action@master
with:
type: bash,python
- uses: actions/upload-artifact@v4
with:
name: reports
path: reports
if-no-files-found: error
test:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Print Python version
run: python -V
- name: Checkout
uses: actions/checkout@v4
- name: Load pip cache
uses: actions/cache@v4
with:
path: .pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-
pip-
- name: Install apt requirements
run: sudo apt-get install gcc libssl-dev python3-dev swig
- name: Install requirements
run: |
sudo apt-get update
sudo apt-get install -y bleachbit chkrootkit fwupd rkhunter modemmanager
pip --cache-dir=.pip install --upgrade pip
pip --cache-dir=.pip install coverage
pip --cache-dir=.pip install -r requirements.txt
- name: Run tests with coverage
run: coverage run
working-directory: ${{ github.workspace }}
- name: Create coverage reports
run: |
coverage report | tee coverage.txt
coverage html
coverage xml
coverage json
working-directory: ${{ github.workspace }}
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: Coverage
path: |
${{ github.workspace }}/coverage.txt
${{ github.workspace }}/coverage.xml
${{ github.workspace }}/coverage.json
${{ github.workspace }}/htmlcov
if-no-files-found: error
- name: Upload results to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ github.workspace }}/coverage.xml