-
Notifications
You must be signed in to change notification settings - Fork 49
105 lines (86 loc) · 3.16 KB
/
build.yml
File metadata and controls
105 lines (86 loc) · 3.16 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
name: Build & Test
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
pull-requests: read
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Detect multik-openblas changes
uses: dorny/paths-filter@v4
id: changes
if: github.event_name != 'workflow_dispatch'
with:
filters: |
openblas:
- 'multik-openblas/**'
- 'buildSrc/src/main/kotlin/multik.cmake-build.gradle.kts'
- name: Setup JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
# ── Full build (openblas changed or manual trigger) ──
- name: Cache OpenBLAS native build
if: steps.changes.outputs.openblas == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/cache@v5
with:
path: multik-openblas/build/cmake-build
key: openblas-${{ runner.os }}-${{ hashFiles('multik-openblas/multik_jni/CMakeLists.txt', 'multik-openblas/multik_jni/src/**') }}
restore-keys: |
openblas-${{ runner.os }}-${{ hashFiles('multik-openblas/multik_jni/CMakeLists.txt') }}
openblas-${{ runner.os }}-
- name: Build OpenBLAS native library
if: steps.changes.outputs.openblas == 'true' || github.event_name == 'workflow_dispatch'
run: ./gradlew :multik-openblas:build_cmake
- name: Assemble all modules
if: steps.changes.outputs.openblas == 'true' || github.event_name == 'workflow_dispatch'
run: ./gradlew assemble
- name: Run all tests
if: steps.changes.outputs.openblas == 'true' || github.event_name == 'workflow_dispatch'
run: ./gradlew check
# ── Partial build (openblas unchanged) ──
- name: Build and test multik-core and multik-kotlin
if: steps.changes.outputs.openblas == 'false'
run: ./gradlew :multik-core:build :multik-kotlin:build
- name: Build multik-openblas and multik-default (JVM only)
if: steps.changes.outputs.openblas == 'false'
run: >
./gradlew
:multik-openblas:compileKotlinJvm
:multik-default:compileKotlinJvm
-x :multik-openblas:copyNativeLibs
-x :multik-openblas:build_cmake
-x :multik-openblas:compileCmake
-x :multik-openblas:configureCmake
-x :multik-openblas:createBuildDir
# ── Reports ──
- name: Test report
if: always()
uses: mikepenz/action-junit-report@v6
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: test-reports
path: '**/build/reports/tests/'
retention-days: 14