-
Notifications
You must be signed in to change notification settings - Fork 22
158 lines (157 loc) · 5.21 KB
/
main.yml
File metadata and controls
158 lines (157 loc) · 5.21 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
on:
push:
branches:
- main
- develop
tags-ignore:
- 'v*'
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
#
# Verify the build and installation of SDB.
#
install:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.10', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python3 -m pip install --upgrade pip setuptools wheel
- run: python3 -m pip install .
#
# The statement below is used for debugging the Github job.
#
- run: python3 --version
#
# Verify "pylint" runs successfully.
#
# Note, we need to have "drgn" installed in order to run "pylint".
# Thus, prior to running "pylint" we have to clone, build, and install
# the "drgn" from source (there's no package currently available).
#
pylint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: ./.github/scripts/install-drgn.sh
- run: python3 -m pip install pylint pytest
- run: python3 -m pip install .
- run: pylint -d duplicate-code -d invalid-name -d missing-docstring -d import-outside-toplevel -d too-many-branches -d missing-module-docstring -d missing-function-docstring sdb
- run: pylint -d duplicate-code -d invalid-name -d missing-docstring -d import-outside-toplevel -d too-many-branches -d missing-module-docstring -d missing-function-docstring tests
#
# Verify "pytest" runs successfully on unit tests.
#
# Note, we need to have "drgn" installed in order to run "pytest". Thus,
# prior to running "pytest" we have to clone, build, and install the
# "drgn" from source (there's no package currently available).
#
pytest-unit:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.10', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python3 -m pip install pytest pytest-cov
- run: ./.github/scripts/install-drgn.sh
- run: python3 -m pip install .
- run: pytest -v --cov sdb --cov-report xml tests/unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
#
# Verify "pytest" runs successfully on integration tests with crash dumps.
#
# Note, we need to have "drgn" and "libkdumpfile" installed to run pytest
# with crash dumps. We download both reference dumps for full integration testing.
#
pytest-integration:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.10', '3.12']
env:
AWS_DEFAULT_REGION: 'us-west-2'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python3 -m pip install pytest pytest-cov
- run: ./.github/scripts/install-libkdumpfile.sh
- run: ./.github/scripts/install-drgn.sh
- run: python3 -m pip install .
- run: ./.github/scripts/download-dumps-from-gdrive.sh
- run: ./.github/scripts/extract-dump.sh dump.201912060006.tar.lzma
- run: ./.github/scripts/extract-dump.sh dump.202303131823.tar.gz
- run: pytest -v --cov sdb --cov-report xml tests/integration
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
#
# Verify "yapf" runs successfully.
#
yapf:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python3 -m pip install yapf
- run: yapf --diff --style google --recursive sdb
- run: yapf --diff --style google --recursive tests
#
# Verify "ruff" runs successfully.
#
ruff:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python3 -m pip install ruff
- run: ruff check sdb tests
#
# Verify "mypy" runs successfully.
#
# Note, we need to have "drgn" installed in order to run "mypy".
# Thus, prior to running "mypy" we have to clone, build, and install
# the "drgn" from source (there's no package currently available).
#
# Also note that we supply --ignore-missing-imports to the tests package
# because pytest doesn't provide stubs on typeshed.
#
mypy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: ./.github/scripts/install-drgn.sh
- run: python3 -m pip install mypy pytest
- run: python3 -m pip install .
- run: python3 -m mypy --strict --show-error-codes -p sdb
- run: python3 -m mypy --strict --ignore-missing-imports --show-error-codes -p tests