Skip to content
Snippets Groups Projects
Commit f118e9fc authored by Allan Blanchard's avatar Allan Blanchard Committed by Jan Rochel
Browse files

[alias] Move CI to Frama-C CI

parent 4cb37252
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@
, ppx_deriving_yaml
, ppx_deriving_yojson
, ppx_import
, unionFind
, yojson
, which
, why3
......@@ -91,6 +92,7 @@ stdenvNoCC.mkDerivation rec {
ppx_deriving_yaml
ppx_deriving_yojson
ppx_import
unionFind
yojson
which
why3
......
......@@ -33,6 +33,7 @@
, ppx_deriving_yaml
, ppx_deriving_yojson
, ppx_import
, unionFind
, yojson
, which
, why3
......@@ -92,6 +93,7 @@ stdenvNoCC.mkDerivation rec {
ppx_deriving_yaml
ppx_deriving_yojson
ppx_import
unionFind
yojson
which
yaml
......
......@@ -17,6 +17,7 @@ mk_tests {
@tests/scope/ptests \
@tests/sparecode/ptests \
@src/plugins/aorai/tests/ptests \
@src/plugins/alias/tests/ptests \
@src/plugins/dive/tests/ptests \
@src/plugins/instantiate/tests/ptests \
@src/plugins/loop_analysis/tests/ptests \
......
################################################################################
### STAGES
stages:
- tests
################################################################################
### DEFAULT JOB PARAMETERS
default:
tags: [nix-v2]
################################################################################
### VARIABLES
variables:
DEFAULT: "master"
OCAML: "4.11"
################################################################################
### TESTS
build-and-test:
stage: tests
script:
- ./nix/ci.sh
check-headers:
stage: tests
variables:
CI_MODE: "check-headers"
script:
- ./nix/ci.sh
lint:
stage: tests
variables:
CI_MODE: "lint"
script:
- ./nix/ci.sh
{ mk_plugin,
unionFind }:
mk_plugin {
plugin-name = "alias" ;
plugin-src = fetchGit { shallow=true ; url=./.. ; } ;
additional-build-inputs = [
unionFind
] ;
}
#!/usr/bin/env bash
set -euxo pipefail
DEFAULT=${DEFAULT:-master}
NIX_TARGET="alias"
# <plugin> /nix /ci.sh
PLUGIN_DIR="$(dirname "$(dirname "$(readlink -f "$0")")")"
CURRENT_BRANCH="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-}"
: "${CURRENT_BRANCH:="${CI_COMMIT_REF_NAME:-}"}"
: "${CURRENT_BRANCH:="$(git branch --show-current)"}"
# prints
# - "$CURRENT_BRANCH" if it is a branch name in remote $1,
# - else "$DEFAULT" if it is set and $DEFAULT is a branch name in remote $1,
# - else master
get_matching_branch () {
if git ls-remote --quiet --exit-code "$1" "$CURRENT_BRANCH" >/dev/null 2>/dev/null;
then echo "$CURRENT_BRANCH"
elif git ls-remote --quiet --exit-code "$1" "$DEFAULT" >/dev/null 2>/dev/null;
then echo "$DEFAULT"
else echo master
fi
}
TMP_DIR="$(mktemp -d)"
cleanup () {
rm -rf $TMP_DIR
}
trap cleanup EXIT
mkdir -p $TMP_DIR/frama-ci
frama_ci_repo="$(readlink -f $TMP_DIR/frama-ci)"
frama_ci_url="git@git.frama-c.com:frama-c/Frama-CI.git"
frama_ci_branch="$(get_matching_branch "$frama_ci_url")"
echo "using branch $frama_ci_branch of Frama-CI repo at $frama_ci_repo"
git clone --depth=1 --branch="$frama_ci_branch" "$frama_ci_url" "$frama_ci_repo"
source $frama_ci_repo/common-plugin-ci.sh
{ frama-c-repo ? builtins.trace "alias: defaulting frama-c-repo to ${toString ../../frama-c}" ../../frama-c }:
let
ocamlOverlay = oself: osuper: {
alias = oself.callPackage ./alias.nix {};
};
overlay = self: super: {
ocaml-ng = super.lib.mapAttrs (
name: value:
if builtins.hasAttr "overrideScope'" value
then value.overrideScope' ocamlOverlay
else value
) super.ocaml-ng;
};
pkgs = (import (frama-c-repo + "/nix/pkgs.nix")).appendOverlays [ overlay ];
in
pkgs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment