Skip to content

Commit 0c82ae5

Browse files
Merge pull request #791 from lukaszstolarczuk/order-ci-pt1
[CI] New workflows order part1
2 parents 112802c + 10b9391 commit 0c82ae5

20 files changed

+171
-192
lines changed

.github/workflows/bandit.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ jobs:
2929
sudo apt-get update
3030
sudo apt-get install -y doxygen
3131
32-
- name: Install pip requirements
33-
run: python3 -m pip install -r third_party/requirements.txt
32+
# Latest distros do not allow global pip installation
33+
- name: Install Python requirements in venv
34+
run: |
35+
python3 -m venv .venv
36+
. .venv/bin/activate
37+
echo "$PATH" >> $GITHUB_PATH
38+
python3 -m pip install -r third_party/requirements.txt
3439
3540
- name: Setup PATH for python
3641
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

.github/workflows/pr_push.yml

Lines changed: 29 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Checks required for a PR to merge. This workflow mostly call other workflows.
1+
# Run checks required for a PR to merge and verify if post-merge commit is valid.
2+
# This workflow only call other workflows.
23
name: PR/push
34

45
on:
@@ -15,101 +16,54 @@ permissions:
1516
contents: read
1617

1718
jobs:
18-
CodeStyle:
19-
name: Coding style
20-
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
21-
22-
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25-
with:
26-
fetch-depth: 0
27-
28-
- name: Install apt packages
29-
run: |
30-
sudo apt-get update
31-
sudo apt-get install -y black cmake clang-format-15 cmake-format libhwloc-dev
32-
33-
- name: Configure CMake
34-
run: >
35-
cmake
36-
-B ${{github.workspace}}/build
37-
-DUMF_FORMAT_CODE_STYLE=ON
38-
-DUMF_BUILD_TESTS=OFF
39-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
40-
-DUMF_BUILD_CUDA_PROVIDER=OFF
41-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
42-
43-
- name: Check C/C++ formatting
44-
run: cmake --build build --target clang-format-check
45-
46-
- name: Check CMake formatting
47-
run: |
48-
cmake --build build --target cmake-format-apply
49-
git diff --exit-code
50-
51-
- name: Check Python formatting
52-
run: cmake --build build --target black-format-check
53-
19+
CodeChecks:
20+
uses: ./.github/workflows/reusable_checks.yml
5421
DocsBuild:
55-
name: Build docs
56-
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
57-
58-
steps:
59-
- name: Checkout repository
60-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
61-
with:
62-
fetch-depth: 0
63-
64-
- name: Install doxygen
65-
run: |
66-
sudo apt-get update
67-
sudo apt-get install -y doxygen
68-
69-
- name: Install pip requirements
70-
run: python3 -m pip install -r third_party/requirements.txt
71-
72-
- name: Setup PATH for python
73-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
74-
75-
- name: Build the documentation
76-
working-directory: scripts
77-
run: python3 generate_docs.py
78-
79-
Spellcheck:
80-
uses: ./.github/workflows/spellcheck.yml
22+
uses: ./.github/workflows/reusable_docs_build.yml
8123
FastBuild:
8224
name: Fast builds
83-
needs: [Spellcheck, CodeStyle]
84-
uses: ./.github/workflows/fast.yml
25+
needs: [CodeChecks, DocsBuild]
26+
uses: ./.github/workflows/reusable_fast.yml
8527
Build:
8628
name: Basic builds
8729
needs: [FastBuild]
88-
uses: ./.github/workflows/basic.yml
30+
uses: ./.github/workflows/reusable_basic.yml
8931
DevDax:
9032
needs: [FastBuild]
91-
uses: ./.github/workflows/dax.yml
33+
uses: ./.github/workflows/reusable_dax.yml
9234
Sanitizers:
9335
needs: [FastBuild]
94-
uses: ./.github/workflows/sanitizers.yml
36+
uses: ./.github/workflows/reusable_sanitizers.yml
9537
Qemu:
9638
needs: [FastBuild]
97-
uses: ./.github/workflows/qemu.yml
39+
uses: ./.github/workflows/reusable_qemu.yml
9840
Benchmarks:
9941
needs: [Build]
100-
uses: ./.github/workflows/benchmarks.yml
42+
uses: ./.github/workflows/reusable_benchmarks.yml
10143
ProxyLib:
10244
needs: [Build]
103-
uses: ./.github/workflows/proxy_lib.yml
45+
uses: ./.github/workflows/reusable_proxy_lib.yml
10446
GPU:
10547
needs: [Build]
106-
uses: ./.github/workflows/gpu.yml
48+
uses: ./.github/workflows/reusable_gpu.yml
10749
Valgrind:
10850
needs: [Build]
109-
uses: ./.github/workflows/valgrind.yml
51+
uses: ./.github/workflows/reusable_valgrind.yml
11052
MultiNuma:
11153
needs: [Build]
112-
uses: ./.github/workflows/multi_numa.yml
54+
uses: ./.github/workflows/reusable_multi_numa.yml
11355
Coverage:
11456
needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib]
115-
uses: ./.github/workflows/coverage.yml
57+
uses: ./.github/workflows/reusable_coverage.yml
58+
CodeQL:
59+
needs: [Build]
60+
permissions:
61+
contents: read
62+
security-events: write
63+
uses: ./.github/workflows/reusable_codeql.yml
64+
Trivy:
65+
needs: [Build]
66+
permissions:
67+
contents: read
68+
security-events: write
69+
uses: ./.github/workflows/reusable_trivy.yml
File renamed without changes.

.github/workflows/reusable_checks.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Basic checks on the code, incl. coding style, spelling, bandit analysis.
2+
# TODO: add license check
3+
name: Basic checks
4+
5+
on: workflow_call
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
CodeChecks:
12+
name: Basic code checks
13+
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
18+
with:
19+
fetch-depth: 0
20+
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
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 bandit
33+
34+
- name: Configure CMake
35+
run: >
36+
cmake
37+
-B ${{github.workspace}}/build
38+
-DUMF_FORMAT_CODE_STYLE=ON
39+
-DUMF_BUILD_TESTS=OFF
40+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
41+
-DUMF_BUILD_CUDA_PROVIDER=OFF
42+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
43+
44+
- name: Check C/C++ formatting
45+
run: cmake --build build --target clang-format-check
46+
47+
- name: Check CMake formatting
48+
run: |
49+
cmake --build build --target cmake-format-apply
50+
git diff --exit-code
51+
52+
- name: Check Python formatting
53+
run: cmake --build build --target black-format-check
54+
55+
- name: Run a spell check
56+
uses: crate-ci/typos@b63f421581dce830bda2f597a678cb7776b41877 # v1.18.2
57+
with:
58+
config: ./.github/workflows/.spellcheck-conf.toml
59+
60+
# Run Bandit recursively, but omit _deps directory (with 3rd party code) and python's venv
61+
- name: Run Bandit
62+
run: python3 -m bandit -r . -x '/_deps/,/.venv/'

.github/workflows/codeql.yml renamed to .github/workflows/reusable_codeql.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
# CodeQL static analysis
22
name: CodeQL
33

4-
# Due to lower score on Scorecard we're running this separately from
5-
# "PR/push" workflow. For some reason permissions weren't properly set
6-
# or recognized (by Scorecard). If Scorecard changes its behavior we can
7-
# go back to use 'workflow_call' trigger.
8-
on:
9-
push:
10-
branches-ignore:
11-
- 'dependabot/**'
12-
pull_request:
13-
14-
concurrency:
15-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16-
cancel-in-progress: true
4+
on: workflow_call
175

186
permissions:
197
contents: read
@@ -56,27 +44,34 @@ jobs:
5644
with:
5745
languages: cpp
5846

59-
- name: Initialize vcpkg
60-
if: ${{ matrix.os == 'windows-latest' }}
47+
- name: "[Win] Initialize vcpkg"
48+
if: matrix.os == 'windows-latest'
6149
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
6250
with:
6351
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
6452
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
6553
vcpkgJsonGlob: '**/vcpkg.json'
6654

67-
- name: Install dependencies
68-
if: ${{ matrix.os == 'windows-latest' }}
69-
run: vcpkg install
70-
shell: pwsh # Specifies PowerShell as the shell for running the script.
55+
- name: "[Win] Install dependencies"
56+
if: matrix.os == 'windows-latest'
57+
run: |
58+
vcpkg install
59+
python3 -m pip install -r third_party/requirements.txt
7160
72-
- name: Install apt packages
61+
- name: "[Lin] Install apt packages"
7362
if: matrix.os == 'ubuntu-latest'
7463
run: |
7564
sudo apt-get update
7665
sudo apt-get install -y cmake clang libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
7766
78-
- name: Install pip packages
79-
run: python3 -m pip install -r third_party/requirements.txt
67+
# Latest distros do not allow global pip installation
68+
- name: "[Lin] Install Python requirements in venv"
69+
if: matrix.os == 'ubuntu-latest'
70+
run: |
71+
python3 -m venv .venv
72+
. .venv/bin/activate
73+
echo "$PATH" >> $GITHUB_PATH
74+
python3 -m pip install -r third_party/requirements.txt
8075
8176
- name: Configure CMake
8277
run: >

.github/workflows/coverage.yml renamed to .github/workflows/reusable_coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Coverage build
1+
# Coverage build - gather artifacts from other builds and merge them into a single report
22
name: Coverage
33

44
on: workflow_call
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
fetch-depth: 0
2222

23-
- name: Install dependencies (ubuntu-latest)
23+
- name: Install dependencies
2424
run: |
2525
sudo apt-get update
2626
sudo apt-get install -y lcov
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docs build
2+
3+
on: workflow_call
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
DocsBuild:
10+
name: Docs build
11+
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install doxygen
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y doxygen
23+
24+
# Latest distros do not allow global pip installation
25+
- name: Install Python requirements in venv
26+
run: |
27+
python3 -m venv .venv
28+
. .venv/bin/activate
29+
echo "$PATH" >> $GITHUB_PATH
30+
python3 -m pip install -r third_party/requirements.txt
31+
32+
- name: Build the documentation
33+
working-directory: scripts
34+
run: python3 generate_docs.py

.github/workflows/fast.yml renamed to .github/workflows/reusable_fast.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,6 @@ jobs:
133133
working-directory: ${{env.BUILD_DIR}}
134134
run: ctest --output-on-failure --test-dir test -C Release
135135

136-
- name: check /DEPENDENTLOADFLAG (Windows only)
137-
if: matrix.os == 'windows-latest'
138-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/Release/umf.dll
139-
shell: pwsh
140-
141-
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll
142-
if: matrix.os == 'windows-latest'
143-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/src/proxy_lib/Release/umf_proxy.dll
144-
shell: pwsh
145-
146136
# TODO: We could add some script to verify metadata of dll's (selected fields, perhaps)
147137
# ref. https://superuser.com/questions/381276/what-are-some-nice-command-line-ways-to-inspect-dll-exe-details
148138
- name: Print metadata of our dll's
File renamed without changes.

.github/workflows/qemu.yml renamed to .github/workflows/reusable_qemu.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ jobs:
2929
sudo apt-get update
3030
sudo apt-get install -y qemu-system genisoimage qemu-utils \
3131
libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils
32-
pip install -r umf/scripts/qemu/requirements.txt
32+
33+
# Latest distros do not allow global pip installation
34+
- name: Install Python requirements in venv
35+
run: |
36+
python3 -m venv .venv
37+
. .venv/bin/activate
38+
echo "$PATH" >> $GITHUB_PATH
39+
python3 -m pip install -r umf/scripts/qemu/requirements.txt
3340
3441
- name: Add user to kvm group
3542
run: sudo usermod -a -G kvm,libvirt $USER

0 commit comments

Comments
 (0)