Skip to content

Commit 061c059

Browse files
committed
Add Julia cross-compilation workflows
1 parent 66137f3 commit 061c059

File tree

3 files changed

+122
-64
lines changed

3 files changed

+122
-64
lines changed

.github/julia/build_tarballs.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
3333
-DCMAKE_BUILD_TYPE=Release \
3434
-DBUILD_SHARED_LIBS=${BUILD_SHARED} \
3535
-DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \
36-
-DFAST_BUILD=ON ..
36+
-DHIPO=ON \
37+
-DBLAS_ROOT="${prefix}" \
38+
-DMETIS_ROOT=${prefix} \
39+
..
3740
3841
if [[ "${target}" == *-linux-* ]]; then
3942
make -j ${nproc}
@@ -60,6 +63,8 @@ platforms = expand_cxxstring_abis(platforms)
6063
dependencies = [
6164
Dependency("CompilerSupportLibraries_jll"),
6265
Dependency("Zlib_jll"),
66+
Dependency("METIS_jll"),
67+
Dependency("OpenBLAS32_jll"),
6368
HostBuildDependency(PackageSpec(; name="CMake_jll")),
6469
]
6570

.github/workflows/julia-tests-ubuntu.yml

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

.github/workflows/julia-tests.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: JuliaCompileAndTest
2+
on:
3+
push:
4+
branches: [master, latest]
5+
pull_request:
6+
types: [opened, synchronize, ready_for_review, reopened]
7+
# needed to allow julia-actions/cache to delete old caches that it has created
8+
permissions:
9+
actions: write
10+
contents: read
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
triplet: ['x86_64-linux-gnu-cxx11', 'aarch64-apple-darwin', 'x86_64-w64-mingw32-cxx11']
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: julia-actions/setup-julia@v2
21+
with:
22+
version: "1.7"
23+
arch: x64
24+
- uses: julia-actions/cache@v2
25+
- run: |
26+
git fetch --tags
27+
echo "HIGHS_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" >> $GITHUB_ENV
28+
if [ "${{ github.event_name }}" = "pull_request" ]; then
29+
echo "HIGHS_COMMIT=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
30+
echo "HIGHS_URL=${{ github.event.pull_request.head.repo.clone_url }}" >> $GITHUB_ENV
31+
else
32+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
33+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
34+
fi
35+
- run: |
36+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
37+
julia --color=yes .github/julia/build_tarballs.jl ${{ matrix.triplet }} --verbose --deploy="local"
38+
env:
39+
BINARYBUILDER_AUTOMATIC_APPLE: true
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: ${{ matrix.triplet }}
43+
path: ${{ github.workspace }}/products/*
44+
- uses: actions/upload-artifact@v4
45+
with:
46+
name: ${{ matrix.triplet }}-jll
47+
path: /home/runner/.julia/dev/HiGHS_jll
48+
test:
49+
runs-on: ${{ matrix.os }}
50+
needs: build
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
include:
55+
- triplet: 'x86_64-linux-gnu-cxx11'
56+
os: 'ubuntu-latest'
57+
arch: x64
58+
- triplet: 'aarch64-apple-darwin'
59+
os: 'macos-14'
60+
arch: aarch64
61+
- triplet: 'x86_64-w64-mingw32-cxx11'
62+
os: 'windows-latest'
63+
arch: x64
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: julia-actions/setup-julia@v2
67+
with:
68+
version: "1.10"
69+
arch: ${{ matrix.arch }}
70+
# Download and setup the artifact
71+
- uses: actions/download-artifact@v4
72+
with:
73+
name: ${{ matrix.triplet }}
74+
path: ${{ github.workspace }}/products
75+
- shell: bash
76+
run: tar -xzf products/HiGHS.*.${{ matrix.triplet }}.tar.gz -C products
77+
# We also need to download the JLL package, because it contains the new
78+
# dependencies
79+
- uses: actions/download-artifact@v4
80+
with:
81+
name: ${{ matrix.triplet }}-jll
82+
path: ${{ github.workspace }}/HiGHS_jll
83+
# We need to update the [compat] section in HiGHS to support HiGHS_jll
84+
- shell: julia --color=yes {0}
85+
run: |
86+
using Pkg
87+
Pkg.develop("HiGHS")
88+
project_filename = joinpath(Pkg.devdir(), "HiGHS", "Project.toml")
89+
project = read(project_filename, String)
90+
write(
91+
project_filename,
92+
replace(project, r"HiGHS_jll = \"=.+?\"" => "HiGHS_jll = \"1\""),
93+
)
94+
# Now we need to update the Artifacts.toml in the HiGHS_jll that we've
95+
# downloaded. Otherwise Julia will try to download the default on install.
96+
- shell: julia --color=yes {0}
97+
run: |
98+
import Pkg
99+
file = joinpath(ENV["GITHUB_WORKSPACE"], "HiGHS_jll", "Artifacts.toml")
100+
m = match(r"git-tree-sha1 = \"(.+?)\"", read(file, String))
101+
dir = escape_string(joinpath(ENV["GITHUB_WORKSPACE"], "products"))
102+
write(
103+
joinpath(homedir(), ".julia", "artifacts", "Overrides.toml"),
104+
"$(m[1]) = \"$(dir)\"\n",
105+
)
106+
Pkg.develop(; path = joinpath(ENV["GITHUB_WORKSPACE"], "HiGHS_jll"))
107+
- shell: julia --color=yes {0}
108+
run: |
109+
import HiGHS_jll
110+
file = joinpath(ENV["GITHUB_WORKSPACE"], "check", "instances", "flugpl.mps")
111+
run(`$(HiGHS_jll.highs()) --solver=hipo $file`)
112+
run(`$(HiGHS_jll.highs()) $file`)
113+
- shell: julia --color=yes {0}
114+
run: |
115+
using Pkg
116+
Pkg.test("HiGHS")

0 commit comments

Comments
 (0)