Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
45f057ba
Commit
45f057ba
authored
2 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[ci] external plugin ci depends on OCAML
parent
09b65855
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nix/external-plugin-ci.sh
+50
-57
50 additions, 57 deletions
nix/external-plugin-ci.sh
with
50 additions
and
57 deletions
nix/external-plugin-ci.sh
+
50
−
57
View file @
45f057ba
...
@@ -5,18 +5,15 @@ set -euxo pipefail
...
@@ -5,18 +5,15 @@ set -euxo pipefail
if
[[
$#
!=
1
]]
;
if
[[
$#
!=
1
]]
;
then
then
cat
<<
EOF
cat
<<
EOF
usage:
$0
<plugin> | all
usage: OCAML=N_MM
$0
<plugin>
$0
all run CI on all plugins
$0
<plugin_name> run CI on this plugin
$0
<plugin_name> run CI only on this plugins
EOF
EOF
exit
2
exit
2
fi
fi
# all plugins to check
if
[
-z
${
OCAML
+x
}
]
;
then
all_plugins
=(
Volatile
)
echo
"OCAML variable must be set to a version of OCaml"
if
[[
"
$1
"
=
"all"
]]
;
exit
2
then
plugins
=(
"
${
all_plugins
[@]
}
"
)
else
plugins
=(
"
$1
"
)
fi
fi
DEFAULT
=
${
DEFAULT
:-
master
}
DEFAULT
=
${
DEFAULT
:-
master
}
...
@@ -51,59 +48,55 @@ cleanup () {
...
@@ -51,59 +48,55 @@ cleanup () {
trap
cleanup EXIT
trap
cleanup EXIT
do_plugin
()
{
OPTS
=
"--arg frama-c-repo
$curdir
"
OPTS
=
"--arg frama-c-repo
$curdir
"
plugin
=
$1
plugin
=
$1
cd
"
$(
mktemp
-d
)
"
cd
"
$(
mktemp
-d
)
"
# the hash of the derivation depends on the directory name
mkdir
"
$plugin
"
# the hash of the derivation depends on the directory name
cd
"
$plugin
"
mkdir
"
$plugin
"
plugin_repo
=
"
$(
readlink
-f
.
)
"
cd
"
$plugin
"
plugin_url
=
"git@git.frama-c.com:frama-c/
$plugin
.git"
plugin_repo
=
"
$(
readlink
-f
.
)
"
plugin_url
=
"git@git.frama-c.com:frama-c/
$plugin
.git"
plugin_branch
=
"
$(
get_matching_branch
"
$plugin_url
"
"
$git_current_branch
"
)
"
echo
"using branch
$plugin_branch
of
$plugin_url
"
plugin_branch
=
"
$(
get_matching_branch
"
$plugin_url
"
"
$git_current_branch
"
)
"
git clone
--depth
=
1
--branch
=
"
$plugin_branch
"
"
$plugin_url
"
.
echo
"using branch
$plugin_branch
of
$plugin_url
"
git clone
--depth
=
1
--branch
=
"
$plugin_branch
"
"
$plugin_url
"
.
declare
-A
deps
=(
)
declare
-A
dirs
=(
)
declare
-A
deps
=(
)
declare
-A
dirs
=(
)
if
[[
-f
"./nix/dependencies"
]]
;
then
while
read
-r
var value
;
do
deps[
$var
]=
$value
done
<
"./nix/dependencies"
for
repo
in
${
!deps[@]
}
;
do
# the hash of the derivation depends on the directory name
mkdir
"../
$repo
"
directory
=
"
$(
readlink
-f
../
$repo
)
"
dirs
[
$repo
]=
$directory
url
=
${
deps
[
$repo
]
}
branch
=
"
$(
get_matching_branch
"
$url
"
"
$git_current_branch
"
)
"
echo
"using branch
$branch
of
$repo
at
$directory
"
# clone
git clone
--depth
=
1
--branch
=
"
$branch
"
"
$url
"
"
$directory
"
OPTS
=
"
$OPTS
--arg
$repo
$directory
"
done
fi
# run the build
if
[[
-f
"./nix/dependencies"
]]
;
then
nix-build
--no-out-link
"./nix/pkgs.nix"
$OPTS
-A
ocaml-ng.ocamlPackages_4_12.
"
$plugin
"
while
read
-r
var value
;
do
deps[
$var
]=
$value
done
<
"./nix/dependencies"
cd
"
$curdir
"
for
repo
in
${
!deps[@]
}
;
do
# the hash of the derivation depends on the directory name
mkdir
"../
$repo
"
directory
=
"
$(
readlink
-f
../
$repo
)
"
dirs
[
$repo
]=
$directory
for
repo
in
${
!dirs[@]
}
;
do
url
=
${
deps
[
$repo
]
}
if
[[
-n
${
dirs
[
$repo
]
}
]]
;
branch
=
"
$(
get_matching_branch
"
$url
"
"
$git_current_branch
"
)
"
then
rm
-rf
"
${
dirs
[
$repo
]
}
"
echo
"using branch
$branch
of
$repo
at
$directory
"
fi
# clone
git clone
--depth
=
1
--branch
=
"
$branch
"
"
$url
"
"
$directory
"
OPTS
=
"
$OPTS
--arg
$repo
$directory
"
done
done
fi
r
m
-rf
"
$plugin_repo
"
#
r
un the build
}
nix-build
--no-out-link
"./nix/pkgs.nix"
$OPTS
-A
ocaml-ng.ocamlPackages_
$OCAML
.
"
$plugin
"
for
plugin
in
"
${
plugins
[@]
}
"
;
do
cd
"
$curdir
"
do_plugin
$plugin
for
repo
in
${
!dirs[@]
}
;
do
if
[[
-n
${
dirs
[
$repo
]
}
]]
;
then
rm
-rf
"
${
dirs
[
$repo
]
}
"
fi
done
done
rm
-rf
"
$plugin_repo
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment