Skip to content

Commit 962213b

Browse files
authored
Merge pull request #2 from ERGO-Code/cmake
CMake find_project and FetchContent workflows
2 parents 4b973f4 + 6341244 commit 962213b

File tree

3 files changed

+120
-76
lines changed

3 files changed

+120
-76
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: cmake-fetch-content
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
master:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
# os: [ubuntu-latest, windows-latest]
11+
os: [ubuntu-latest]
12+
branch: [master, latest]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Checkout CMakeHighsFetchContent
18+
uses: actions/checkout@v4
19+
with:
20+
repository: galabovaa/CMakeHighsFetchContent
21+
ref: main
22+
path: CMakeHighsFetchContent-main-${{matrix.branch}}
23+
24+
- name: Create build dir
25+
run: |
26+
cmake -E make_directory ${{runner.workspace}}/build-fetch-content-${{matrix.branch}}
27+
28+
- name: Build CMakeFindHighsPackage
29+
working-directory: ${{runner.workspace}}/build-fetch-content-${{matrix.branch}}
30+
shell: bash
31+
run: |
32+
cmake ${{runner.workspace}}/highs-tests/CMakeHighsFetchContent-main-${{matrix.branch}} \
33+
-DBRANCH=${{matrix.branch}}
34+
cmake --build . --parallel
35+
36+
- name: Test
37+
working-directory: ${{runner.workspace}}/build-fetch-content-${{matrix.branch}}
38+
shell: bash
39+
run: |
40+
./main
41+
42+
# todo, not implemented yet in CMakeHighsFetchContent
43+
# - name: Test install
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: cmake-find-highs
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
master:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
# os: [ubuntu-latest, windows-latest]
11+
os: [ubuntu-latest]
12+
branch: [master, latest]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Checkout HiGHS repo
18+
uses: actions/checkout@v4
19+
with:
20+
repository: ERGO-Code/HiGHS
21+
ref: ${{matrix.branch}}
22+
path: HiGHS-${{matrix.branch}}
23+
24+
- name: Checkout CMakeHighsFindPackage
25+
uses: actions/checkout@v4
26+
with:
27+
repository: galabovaa/CMakeHighsFindPackage
28+
ref: master
29+
path: CMakeHighsFindPackage-master-${{matrix.branch}}
30+
31+
- name: Create build and install dirs
32+
run: |
33+
cmake -E make_directory ${{runner.workspace}}/build-highs-${{matrix.branch}}
34+
cmake -E make_directory ${{runner.workspace}}/install-highs-${{matrix.branch}}
35+
cmake -E make_directory ${{runner.workspace}}/build-find-highs-${{matrix.branch}}
36+
37+
# cmake -E make_directory ${{runner.workspace}}/install-find-highs-${{matrix.branch}}
38+
39+
- name: Configure CMake HiGHS
40+
shell: bash
41+
working-directory: ${{runner.workspace}}/build-highs-${{matrix.branch}}
42+
run: |
43+
cmake ${{runner.workspace}}/highs-tests/HiGHS-${{matrix.branch}} \
44+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-highs-${{matrix.branch}}
45+
46+
- name: Build, ctest and install HiGHS
47+
working-directory: ${{runner.workspace}}/build-highs-${{matrix.branch}}
48+
shell: bash
49+
run: |
50+
cmake --build . --parallel
51+
ctest
52+
cmake --install .
53+
54+
# - name: Build and install CMakeFindHighsPackage
55+
- name: Build CMakeFindHighsPackage
56+
working-directory: ${{runner.workspace}}/build-find-highs-${{matrix.branch}}
57+
shell: bash
58+
run: |
59+
cmake ${{runner.workspace}}/highs-tests/CMakeHighsFindPackage-master-${{matrix.branch}} \
60+
-DHIGHS_DIR=${{runner.workspace}}/install-highs-${{matrix.branch}}/lib/cmake/highs
61+
cmake --build . --parallel
62+
63+
# cmake --install .
64+
# -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-find-highs-${{matrix.branch}}
65+
66+
- name: Test build
67+
working-directory: ${{runner.workspace}}/build-find-highs-${{matrix.branch}}
68+
shell: bash
69+
run: |
70+
./main
71+
72+
# does not find highs lib, needs more cmake code in CMakeFindHighsPackage
73+
# - name: Test install
74+
# working-directory: ${{runner.workspace}}/install-find-highs-${{matrix.branch}}
75+
# shell: bash
76+
# run: |
77+
# ./bin/main

.github/workflows/extra-unit-cuda-updates.yml

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

0 commit comments

Comments
 (0)