Skip to content

Commit

Permalink
Add CI job against GAP master and stable-4.13 (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored May 31, 2024
1 parent 597b2f3 commit fed22f9
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 8 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/gap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI with GAP

on:
push:
branches:
- 'master'
- 'release-*'
tags: '*'
pull_request:

concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the default repository branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref_name != github.event.repository.default_branch || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.julia-version }} - GAP ${{ matrix.gap-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
strategy:
fail-fast: false
matrix:
gap-version:
- 'master'
- 'stable-4.13'
julia-version:
- '1.6'
- '1' # latest stable release
- 'nightly'
os:
- ubuntu-latest
include:
# Add a few macOS jobs (the number we can run in parallel is limited)
- gap-version: 'master'
julia-version: '1'
os: macOS-latest
- gap-version: 'stable-4.13'
julia-version: '1'
os: macOS-latest

steps:
- uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- name: Checkout GAP
uses: actions/checkout@v4
with:
repository: 'gap-system/gap'
ref: ${{ matrix.gap-version }}
path: 'GAPROOT'
- name: "Install dependencies (for macOS)"
if: runner.os == 'macOS'
run: |
brew install autoconf zlib # gmp pkg-config
- name: "Build GAP"
run: |
mv GAPROOT /tmp/GAPROOT
cd /tmp/GAPROOT
./autogen.sh
./configure
make -j`nproc`
- name: "Override bundled GAP"
run: |
julia --proj=override etc/setup_override_dir.jl /tmp/GAPROOT /tmp/gap_jll_override
- name: "Run tests"
run: |
julia --proj=override etc/run_with_override.jl /tmp/gap_jll_override --depwarn=error -e "using Pkg; Pkg.test(\"GAP\")"
20 changes: 13 additions & 7 deletions etc/run_with_override.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@ gapoverride = abspath(gapoverride)
#
@info "Install needed packages"
using Pkg
Pkg.add(["GAP_jll"])
Pkg.add(["GAP_lib_jll"])
Pkg.develop(path=dirname(dirname(@__FILE__)))
Pkg.add(["GAP_jll", "GAP_lib_jll"])
Pkg.instantiate()

import GAP_lib_jll

#
#
#
function add_jll_override(depot, pkgname, newdir)
function add_jll_override(depot, pkgname, pkguuid, newdir)
pkgid = Base.identify_package("$(pkgname)_jll")
uuid = string(pkgid.uuid)
# does not work with julia 1.12-dev, see https://github.com/JuliaLang/julia/issues/54599
# TODO: remove pkguuid argument again once that bug is fixed
# pkguuid = string(pkgid.uuid)
mkpath(joinpath(depot, "artifacts"))
open(joinpath(depot, "artifacts", "Overrides.toml"), "a") do f
write(f, """
[$(uuid)]
[$(pkguuid)]
$(pkgname) = "$(newdir)"
""")
end
Expand All @@ -40,8 +43,11 @@ tmpdepot = mktempdir(; cleanup=true)
@info "Created temporary depot at $(tmpdepot)"

# create override file for GAP_jll
add_jll_override(tmpdepot, "GAP", gapoverride)
add_jll_override(tmpdepot, "GAP_lib", gapoverride)
add_jll_override(tmpdepot, "GAP", "5cd7a574-2c56-5be2-91dc-c8bc375b9ddf", gapoverride)
add_jll_override(tmpdepot, "GAP_lib", "de1ad85e-c930-5cd4-919d-ccd3fcafd1a3", gapoverride)

# HACK: use the documentation from GAP_lib_jll instead of rebuilding it
run(`ln -sf $(abspath(GAP_lib_jll.find_artifact_dir(), "share", "gap", "doc")) $(abspath(gapoverride, "share", "gap", "doc"))`)

# prepend our temporary depot to the depot list...
withenv("JULIA_DEPOT_PATH"=>tmpdepot*":", "FORCE_JULIAINTERFACE_COMPILATION" => "true") do
Expand Down
2 changes: 1 addition & 1 deletion etc/setup_override_dir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function gmp_artifact_dir()
hash = Base.SHA1(meta["git-tree-sha1"])
if !artifact_exists(hash)
dl_info = first(meta["download"])
download_artifact(hash, dl_info["url"], dl_info["sha256"])
Pkg.Artifacts.download_artifact(hash, dl_info["url"], dl_info["sha256"])
end
return artifact_path(hash)
end
Expand Down
1 change: 1 addition & 0 deletions src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function regenerate_gaproot()
# add the necessary flags to link against libgap
gap_lib = joinpath(gap_prefix, "lib")
sysinfo["GAP_LDFLAGS"] = "-L$(gap_lib) -lgap"
Sys.isapple() && (sysinfo["GAC_LDFLAGS"] = " -bundle") # Remove this line once the GAP_jll build recipe is fixed

GAP_VERSION = VersionNumber(sysinfo["GAP_VERSION"])
gaproot_packages = joinpath(Base.DEPOT_PATH[1], "gaproot", "v$(GAP_VERSION.major).$(GAP_VERSION.minor)")
Expand Down

0 comments on commit fed22f9

Please sign in to comment.