Skip to content

Commit 4b7004b

Browse files
authored
Merge pull request #4 from ERGO-Code/cmake
Cmake
2 parents e0a9d63 + 63091bc commit 4b7004b

10 files changed

+490
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: cmake-fetch-content
1+
name: cmake-fetch-linux
22

33
on: [push, pull_request]
44

55
jobs:
6-
master:
6+
fetch_ubuntu:
77
runs-on: ${{ matrix.os }}
88
strategy:
9+
fail-fast: false
910
matrix:
10-
# os: [ubuntu-latest, windows-latest]
1111
os: [ubuntu-latest]
1212
branch: [master, latest, cmake]
1313

@@ -23,23 +23,26 @@ jobs:
2323

2424
- name: Create build dir
2525
run: |
26-
cmake -E make_directory ${{runner.workspace}}/build-fetch-content-${{matrix.branch}}
26+
cmake -E make_directory ${{runner.workspace}}/build-fetch-${{matrix.branch}}
2727
2828
- name: Build CMakeFindHighsPackage
29-
working-directory: ${{runner.workspace}}/build-fetch-content-${{matrix.branch}}
29+
working-directory: ${{runner.workspace}}/build-fetch-${{matrix.branch}}
3030
shell: bash
3131
run: |
3232
cmake ${{runner.workspace}}/highs-tests/CMakeHighsFetchContent-main-${{matrix.branch}} \
33-
-DBRANCH=${{matrix.branch}}
33+
-DBRANCH=${{matrix.branch}} \
34+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-fetch-${{matrix.branch}}
3435
cmake --build . --parallel
36+
cmake --install .
3537
3638
- name: Test
37-
working-directory: ${{runner.workspace}}/build-fetch-content-${{matrix.branch}}
39+
working-directory: ${{runner.workspace}}/build-fetch-${{matrix.branch}}
3840
shell: bash
3941
run: |
4042
./main
4143
42-
# todo, not implemented yet in CMakeHighsFetchContent
43-
# - name: Test install
44-
45-
# trigger test
44+
- name: Test install
45+
working-directory: ${{runner.workspace}}/install-fetch-${{matrix.branch}}
46+
shell: bash
47+
run: |
48+
./bin/main
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: cmake-fetch-macos
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
fetch_macos:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [macos-latest]
12+
branch: [master, latest, cmake]
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-${{matrix.branch}}
27+
28+
- name: Build CMakeFindHighsPackage
29+
working-directory: ${{runner.workspace}}/build-fetch-${{matrix.branch}}
30+
shell: bash
31+
run: |
32+
cmake ${{runner.workspace}}/highs-tests/CMakeHighsFetchContent-main-${{matrix.branch}} \
33+
-DBRANCH=${{matrix.branch}} \
34+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-fetch-${{matrix.branch}}
35+
cmake --build . --parallel
36+
cmake --install .
37+
38+
- name: Test
39+
working-directory: ${{runner.workspace}}/build-fetch-${{matrix.branch}}
40+
shell: bash
41+
run: |
42+
./main
43+
44+
- name: Test install
45+
working-directory: ${{runner.workspace}}/install-fetch-${{matrix.branch}}
46+
shell: bash
47+
run: |
48+
./bin/main
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: cmake-fetch-windows
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
fetch_win:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [windows-latest]
12+
branch: [master, latest, cmake]
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+
mkdir ${{runner.workspace}}\\build-fetch-${{matrix.branch}}
27+
28+
- name: Configure CMakeFindHighsPackage
29+
working-directory: ${{runner.workspace}}\\build-fetch-${{matrix.branch}}
30+
run: >-
31+
cmake ${{runner.workspace}}\\highs-tests\\CMakeHighsFetchContent-main-${{matrix.branch}}
32+
-DBRANCH=${{matrix.branch}}
33+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-fetch-${{matrix.branch}}
34+
35+
- name: Build CMakeFindHighsPackage
36+
working-directory: ${{runner.workspace}}\\build-fetch-${{matrix.branch}}
37+
run: |
38+
cmake --build . --parallel --config Release
39+
cmake --install .
40+
41+
- name: Test
42+
working-directory: ${{runner.workspace}}\\build-fetch-${{matrix.branch}}
43+
run: |
44+
.\\Release\\main.exe
45+
46+
- name: Test install
47+
working-directory: ${{runner.workspace}}\\install-fetch-${{matrix.branch}}
48+
shell: bash
49+
run: |
50+
.\\bin\\main.exe
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: cmake-find-build-linux
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
find_b_ubuntu:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ubuntu-latest]
12+
branch: [master, latest, cmake]
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}}-b
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}}-b
30+
31+
- name: Create build and install dirs
32+
run: |
33+
cmake -E make_directory ${{runner.workspace}}/build-highs-${{matrix.branch}}-b
34+
cmake -E make_directory ${{runner.workspace}}/build-find-build-${{matrix.branch}}
35+
cmake -E make_directory ${{runner.workspace}}/install-find-build-${{matrix.branch}}
36+
37+
- name: Configure CMake HiGHS
38+
shell: bash
39+
working-directory: ${{runner.workspace}}/build-highs-${{matrix.branch}}-b
40+
run:
41+
cmake ${{runner.workspace}}/highs-tests/HiGHS-${{matrix.branch}}-b
42+
43+
- name: Build, ctest and install HiGHS
44+
working-directory: ${{runner.workspace}}/build-highs-${{matrix.branch}}-b
45+
shell: bash
46+
run: |
47+
cmake --build . --parallel
48+
ctest
49+
50+
- name: Build CMakeFindHighsPackage
51+
working-directory: ${{runner.workspace}}/build-find-build-${{matrix.branch}}
52+
shell: bash
53+
run: |
54+
cmake ${{runner.workspace}}/highs-tests/CMakeHighsFindPackage-master-${{matrix.branch}}-b \
55+
-DHIGHS_DIR=${{runner.workspace}}/build-highs-${{matrix.branch}}-b \
56+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-find-build-${{matrix.branch}}
57+
cmake --build . --parallel
58+
cmake --install .
59+
60+
- name: Test build
61+
working-directory: ${{runner.workspace}}/build-find-build-${{matrix.branch}}
62+
shell: bash
63+
run: |
64+
./main
65+
66+
- name: Test install
67+
working-directory: ${{runner.workspace}}/install-find-build-${{matrix.branch}}
68+
shell: bash
69+
run: |
70+
LD_LIBRARY_PATH=${{runner.workspace}}/build-highs-${{matrix.branch}}-b/lib ./bin/main
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: cmake-find-build-macos
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
find_b_macos:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [macos-latest]
12+
branch: [master, latest, cmake]
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}}-b
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}}-b
30+
31+
- name: Create build and install dirs
32+
run: |
33+
cmake -E make_directory ${{runner.workspace}}/build-highs-${{matrix.branch}}-b
34+
cmake -E make_directory ${{runner.workspace}}/build-find-build-${{matrix.branch}}
35+
cmake -E make_directory ${{runner.workspace}}/install-find-build-${{matrix.branch}}
36+
37+
- name: Configure CMake HiGHS
38+
shell: bash
39+
working-directory: ${{runner.workspace}}/build-highs-${{matrix.branch}}-b
40+
run:
41+
cmake ${{runner.workspace}}/highs-tests/HiGHS-${{matrix.branch}}-b
42+
43+
- name: Build, ctest and install HiGHS
44+
working-directory: ${{runner.workspace}}/build-highs-${{matrix.branch}}-b
45+
shell: bash
46+
run: |
47+
cmake --build . --parallel
48+
ctest
49+
50+
- name: Build CMakeFindHighsPackage
51+
working-directory: ${{runner.workspace}}/build-find-build-${{matrix.branch}}
52+
shell: bash
53+
run: |
54+
cmake ${{runner.workspace}}/highs-tests/CMakeHighsFindPackage-master-${{matrix.branch}}-b \
55+
-DHIGHS_DIR=${{runner.workspace}}/build-highs-${{matrix.branch}}-b \
56+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install-find-build-${{matrix.branch}}
57+
cmake --build . --parallel
58+
cmake --install .
59+
60+
- name: Test build
61+
working-directory: ${{runner.workspace}}/build-find-build-${{matrix.branch}}
62+
shell: bash
63+
run: |
64+
./main
65+
66+
- name: Test install
67+
working-directory: ${{runner.workspace}}/install-find-build-${{matrix.branch}}
68+
shell: bash
69+
run: |
70+
DYLD_LIBRARY_PATH=${{runner.workspace}}/build-highs-${{matrix.branch}}-b/lib ./bin/main
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: cmake-find-build-windows
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
find_b_win:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [windows-latest]
12+
branch: [master, latest, cmake]
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}}-b
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}}-b
30+
31+
- name: Create build and install dirs
32+
run: |
33+
mkdir ${{runner.workspace}}\\build-highs-${{matrix.branch}}-b
34+
mkdir ${{runner.workspace}}\\build-find-build-${{matrix.branch}}
35+
mkdir ${{runner.workspace}}\\install-find-build-${{matrix.branch}}
36+
37+
- name: Configure CMake HiGHS
38+
working-directory: ${{runner.workspace}}\\build-highs-${{matrix.branch}}-b
39+
run:
40+
cmake ${{runner.workspace}}\\highs-tests\\HiGHS-${{matrix.branch}}-b
41+
42+
- name: Build, ctest and install HiGHS
43+
working-directory: ${{runner.workspace}}\\build-highs-${{matrix.branch}}-b
44+
run: |
45+
cmake --build . --parallel --config Release
46+
ctest -C Release
47+
48+
- name: Configure CMakeFindHighsPackage
49+
working-directory: ${{runner.workspace}}\\build-find-build-${{matrix.branch}}
50+
run: >-
51+
cmake ${{runner.workspace}}\\highs-tests\\CMakeHighsFindPackage-master-${{matrix.branch}}-b
52+
-DHIGHS_DIR=${{runner.workspace}}\\build-highs-${{matrix.branch}}-b
53+
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}\\install-find-build-${{matrix.branch}}
54+
55+
- name: Build and install CMakeFindHighsPackage
56+
working-directory: ${{runner.workspace}}\\build-find-build-${{matrix.branch}}
57+
run: |
58+
cmake --build . --parallel --config Release
59+
cmake --install .
60+
61+
- name: Test build
62+
working-directory: ${{runner.workspace}}\\build-find-build-${{matrix.branch}}
63+
run: |
64+
$env:PATH = '${{runner.workspace}}/build-highs-${{matrix.branch}}-b/bin/Release;' + $env:PATH
65+
echo $Env:PATH
66+
.\\Release\\main.exe
67+
68+
- name: Test install
69+
working-directory: ${{runner.workspace}}\\install-find-build-${{matrix.branch}}
70+
run: |
71+
$env:PATH = '${{runner.workspace}}/build-highs-${{matrix.branch}}-b/bin/Release;' + $env:PATH
72+
echo $Env:PATH
73+
.\\bin\\main.exe

0 commit comments

Comments
 (0)