Skip to content

Commit 0851cfb

Browse files
committed
do basic CI code checks in yhe docker
1 parent a92aa12 commit 0851cfb

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

.github/docker/ubuntu-22.04.Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -37,7 +37,11 @@ ARG MISC_DEPS="\
3737
clang \
3838
python3-pip \
3939
sudo \
40-
whois"
40+
whois \
41+
wget \
42+
libenchant-2-dev \
43+
jq \
44+
doxygen"
4145

4246
# Update and install required packages
4347
RUN apt-get update \
@@ -55,6 +59,7 @@ RUN mkdir --mode 777 /opt/umf/
5559
# Additional dependencies (installed via pip)
5660
COPY third_party/requirements.txt /opt/umf/requirements.txt
5761
RUN pip3 install --no-cache-dir -r /opt/umf/requirements.txt
62+
RUN pip3 install bandit codespell
5863

5964
# Add a new (non-root) 'test_user'
6065
ENV USER test_user

.github/workflows/pr_push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
20+
uses: ./.github/workflows/reusable_docker_checks.yml
2121
DocsBuild:
2222
uses: ./.github/workflows/reusable_docs_build.yml
2323
FastBuild:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Basic checks on the code, incl. coding style, spelling, bandit analysis.
2-
# TODO: add license check
32
name: Basic checks
43

54
on: workflow_call
@@ -10,48 +9,43 @@ permissions:
109
jobs:
1110
CodeChecks:
1211
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
1418

1519
steps:
1620
- name: Checkout repository
17-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1822
with:
1923
fetch-depth: 0
2024

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
3626
run: >
3727
cmake
38-
-B ${{github.workspace}}/build
28+
-B build
3929
-DUMF_FORMAT_CODE_STYLE=ON
4030
-DUMF_BUILD_TESTS=OFF
4131
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
4232
-DUMF_BUILD_CUDA_PROVIDER=OFF
4333
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
4434
4535
- 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
4739
4840
- name: Check CMake formatting
4941
run: |
5042
cmake --build build --target cmake-format-apply
5143
git diff --exit-code
5244
5345
- 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
5549
5650
- name: Run check-license
5751
run: |
@@ -67,10 +61,9 @@ jobs:
6761

6862
- name: Check spelling in docs
6963
run: |
70-
cmake -B build
7164
cmake --build build --target docs
7265
sphinx-build -b spelling ./build/docs_build/config ./build/docs_build/spelling_log -W
7366
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)
7568
- name: Run Bandit
76-
run: python3 -m bandit -r . -x '/_deps/,/.venv/'
69+
run: python3 -m bandit -r . -x '/_deps/'

0 commit comments

Comments
 (0)