1
1
# Basic checks on the code, incl. coding style, spelling, bandit analysis.
2
- # TODO: add license check
3
2
name : Basic checks
4
3
5
4
on : workflow_call
@@ -10,48 +9,43 @@ permissions:
10
9
jobs :
11
10
CodeChecks :
12
11
name : Basic code checks
13
- runs-on : ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
12
+ runs-on : ' DSS-L0-FLEX'
13
+ container :
14
+ image : localhost:5000/umf_docker:latest
15
+ # root is needed at least for the checkout step, see
16
+ # https://github.com/actions/checkout/issues/1575
17
+ options : --user root
14
18
15
19
steps :
16
20
- name : Checkout repository
17
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18
22
with :
19
23
fetch-depth : 0
20
24
21
- - name : Install dependencies
22
- run : |
23
- sudo apt-get update
24
- sudo apt-get install -y black cmake clang-format-15 cmake-format libhwloc-dev doxygen
25
-
26
- # Latest distros do not allow global pip installation
27
- - name : Install Python requirements in venv
28
- run : |
29
- python3 -m venv .venv
30
- . .venv/bin/activate
31
- echo "$PATH" >> $GITHUB_PATH
32
- python3 -m pip install -r third_party/requirements.txt
33
- python3 -m pip install bandit codespell
34
-
35
- - name : Configure CMake
25
+ - name : Configure CMake
36
26
run : >
37
27
cmake
38
- -B ${{github.workspace}}/ build
28
+ -B build
39
29
-DUMF_FORMAT_CODE_STYLE=ON
40
30
-DUMF_BUILD_TESTS=OFF
41
31
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
42
32
-DUMF_BUILD_CUDA_PROVIDER=OFF
43
33
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
44
34
45
35
- name : Check C/C++ formatting
46
- run : cmake --build build --target clang-format-check
36
+ run : |
37
+ cmake --build build --target clang-format-check
38
+ git diff --exit-code
47
39
48
40
- name : Check CMake formatting
49
41
run : |
50
42
cmake --build build --target cmake-format-apply
51
43
git diff --exit-code
52
44
53
45
- name : Check Python formatting
54
- run : cmake --build build --target black-format-check
46
+ run : |
47
+ cmake --build build --target black-format-check
48
+ git diff --exit-code
55
49
56
50
- name : Run check-license
57
51
run : |
67
61
68
62
- name : Check spelling in docs
69
63
run : |
70
- cmake -B build
71
64
cmake --build build --target docs
72
65
sphinx-build -b spelling ./build/docs_build/config ./build/docs_build/spelling_log -W
73
66
74
- # Run Bandit recursively, but omit _deps directory (with 3rd party code) and python's venv
67
+ # Run Bandit recursively, but omit _deps directory (with 3rd party code)
75
68
- name : Run Bandit
76
- run : python3 -m bandit -r . -x '/_deps/,/.venv/ '
69
+ run : python3 -m bandit -r . -x '/_deps/'
0 commit comments