Skip to content

Commit 94b6a26

Browse files
committed
[CI] Add reusable workflows
This commit converts workflows to reusable workflows. Also, it reduces the number of Actions entries started by a single PR/push.
1 parent d940c5e commit 94b6a26

File tree

6 files changed

+72
-4
lines changed

6 files changed

+72
-4
lines changed

.github/workflows/basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: BasicBuilds
22

3-
on: [push, pull_request, workflow_call]
3+
on: workflow_call
44

55
env:
66
BUILD_DIR : "${{github.workspace}}/build/"

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Benchmarks
22

3-
on: [push, pull_request, workflow_call]
3+
on: workflow_call
44

55
jobs:
66
ubuntu-build:

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CodeQL
22

3-
on: [push, pull_request, workflow_call]
3+
on: workflow_call
44

55
concurrency:
66
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/fast_build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Fast build
2+
3+
on: workflow_call
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build:
11+
name: Fast build
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
include:
16+
- os: ubuntu-latest
17+
nproc: $(nproc)
18+
pool_scalable: 'ON'
19+
- os: windows-latest
20+
nproc: $Env:NUMBER_OF_PROCESSORS
21+
pool_scalable: 'OFF'
22+
runs-on: ${{matrix.os}}
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Install apt packages
29+
if: matrix.os == 'ubuntu-latest'
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y cmake clang libnuma-dev libjemalloc-dev libtbb-dev
33+
34+
- name: Install pip packages
35+
run: python3 -m pip install -r third_party/requirements.txt
36+
37+
- name: Configure CMake
38+
run: >
39+
cmake
40+
-B ${{github.workspace}}/build
41+
-DCMAKE_BUILD_TYPE=Release
42+
-DUMF_FORMAT_CODE_STYLE=ON
43+
-DUMF_DEVELOPER_MODE=ON
44+
-DUMF_ENABLE_POOL_TRACKING=ON
45+
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=${{matrix.pool_scalable}}
46+
47+
- name: Build
48+
run: >
49+
cmake --build ${{github.workspace}}/build --config Release -j ${{matrix.nproc}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: PR/push workflow
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
Fast_build:
7+
uses: oneapi-src/unified-memory-framework/.github/workflows/fast_build.yml@main
8+
CodeQL:
9+
needs: [Fast_build]
10+
uses: oneapi-src/unified-memory-framework/.github/workflows/codeql.yml@main
11+
Spellcheck:
12+
needs: [Fast_build]
13+
uses: oneapi-src/unified-memory-framework/.github/workflows/spellcheck.yml@main
14+
Build:
15+
needs: [CodeQL, Spellcheck]
16+
uses: oneapi-src/unified-memory-framework/.github/workflows/basic.yml@main
17+
Benchmark:
18+
needs: [Build]
19+
uses: oneapi-src/unified-memory-framework/.github/workflows/benchmarks.yml@main

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: SpellCheck
22

3-
on: [push, pull_request, workflow_call]
3+
on: workflow_call
44

55
jobs:
66
build:

0 commit comments

Comments
 (0)