Skip to content
Snippets Groups Projects
Commit 4f469d61 authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[ci] Main tests

parent 18650503
No related branches found
No related tags found
No related merge requests found
stages: stages:
- git-update - git-update
- build - build
- tests - tests
- distrib_and_compatibility - distrib_and_compatibility
- make_public - make_public
################################################################################ ################################################################################
### VARIABLES (todo) ### VARIABLES (todo)
...@@ -20,18 +20,18 @@ stages: ...@@ -20,18 +20,18 @@ stages:
check-no-old-frama-c: check-no-old-frama-c:
stage: git-update stage: git-update
script: script:
- (! git merge-base --is-ancestor a1e186c68a6418a53b3dc06237f49e8dcbf75f4a HEAD) - (! git merge-base --is-ancestor a1e186c68a6418a53b3dc06237f49e8dcbf75f4a HEAD)
- git merge-base --is-ancestor a35d2118fe6999dddce9e1847eff626fae9cc37c HEAD - git merge-base --is-ancestor a35d2118fe6999dddce9e1847eff626fae9cc37c HEAD
tags: tags:
- nix - nix
#avoid a nix error https://github.com/NixOS/nix/issues/2087 #avoid a nix error https://github.com/NixOS/nix/issues/2087
git-update: git-update:
stage: git-update stage: git-update
script: script:
- nix-instantiate --eval nix/pkgs.nix -A ocamlPackages.frama-c.src.outPath - nix-instantiate --eval nix/pkgs.nix -A ocamlPackages.frama-c.src.outPath
tags: tags:
- nix - nix
################################################################################ ################################################################################
### BUILD ### BUILD
...@@ -39,7 +39,7 @@ git-update: ...@@ -39,7 +39,7 @@ git-update:
frama-c: frama-c:
stage: build stage: build
script: script:
- nix-build nix/pkgs.nix -A ocamlPackages.frama-c - nix-build nix/pkgs.nix -A ocamlPackages.frama-c
artifacts: artifacts:
when: on_failure when: on_failure
paths: paths:
...@@ -47,11 +47,18 @@ frama-c: ...@@ -47,11 +47,18 @@ frama-c:
- results.log - results.log
expire_in: 1 day expire_in: 1 day
tags: tags:
- nix - nix
################################################################################ ################################################################################
### TESTS ### TESTS
main-tests:
stage: tests
script:
- nix-build nix/pkgs.nix -A ocamlPackages.main-tests
tags:
- nix
################################################################################ ################################################################################
### DISTRIB ### DISTRIB
...@@ -66,13 +73,6 @@ frama-c: ...@@ -66,13 +73,6 @@ frama-c:
# tags: # tags:
# - nix # - nix
# tests:
# stage: tests
# script:
# - nix/frama-ci.sh build -A frama-c.tests
# tags:
# - nix
# wp-qualif: # wp-qualif:
# stage: tests # stage: tests
# script: # script:
...@@ -186,7 +186,6 @@ frama-c: ...@@ -186,7 +186,6 @@ frama-c:
# - nix/frama-ci.sh build -A frama-c.internal # - nix/frama-ci.sh build -A frama-c.internal
# when: manual # when: manual
# internal_nightly: # internal_nightly:
# <<: *internal_template # <<: *internal_template
# script: # script:
...@@ -194,7 +193,6 @@ frama-c: ...@@ -194,7 +193,6 @@ frama-c:
# only: # only:
# - schedules # - schedules
# .build_template: &frama-c-ocaml # .build_template: &frama-c-ocaml
# stage: distrib_and_compatibility # stage: distrib_and_compatibility
# script: # script:
...@@ -264,35 +262,35 @@ frama-c: ...@@ -264,35 +262,35 @@ frama-c:
make_public: make_public:
stage: make_public stage: make_public
script: script:
- (! git merge-base --is-ancestor a1e186c68a6418a53b3dc06237f49e8dcbf75f4a origin/master) - (! git merge-base --is-ancestor a1e186c68a6418a53b3dc06237f49e8dcbf75f4a origin/master)
- echo "$FRAMA_C_PUBLIC_SSH_PRIVATE_KEY" | nix run -f channel:nixos-19.03 coreutils --command base64 -d > nix/frama-c-public/id_ed25519 - echo "$FRAMA_C_PUBLIC_SSH_PRIVATE_KEY" | nix run -f channel:nixos-19.03 coreutils --command base64 -d > nix/frama-c-public/id_ed25519
- nix run -f channel:nixos-19.03 coreutils --command chmod 400 nix/frama-c-public/id_ed25519 - nix run -f channel:nixos-19.03 coreutils --command chmod 400 nix/frama-c-public/id_ed25519
- GIT_SSH=nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git push git@git.frama-c.com:pub/frama-c.git origin/master:refs/heads/master - GIT_SSH=nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git push git@git.frama-c.com:pub/frama-c.git origin/master:refs/heads/master
tags: tags:
- nix - nix
only: only:
- schedules - schedules
make_public_meta: make_public_meta:
stage: make_public stage: make_public
script: script:
- echo "$FRAMA_C_PUBLIC_SSH_PRIVATE_KEY" | nix run -f channel:nixos-19.03 coreutils --command base64 -d > nix/frama-c-public/id_ed25519 - echo "$FRAMA_C_PUBLIC_SSH_PRIVATE_KEY" | nix run -f channel:nixos-19.03 coreutils --command base64 -d > nix/frama-c-public/id_ed25519
- nix run -f channel:nixos-19.03 coreutils --command chmod 400 nix/frama-c-public/id_ed25519 - nix run -f channel:nixos-19.03 coreutils --command chmod 400 nix/frama-c-public/id_ed25519
- GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git clone git@git.frama-c.com:frama-c/meta.git nix/frama-c-public/meta - GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git clone git@git.frama-c.com:frama-c/meta.git nix/frama-c-public/meta
- GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git -C nix/frama-c-public/meta push git@git.frama-c.com:pub/meta origin/master:refs/heads/master - GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git -C nix/frama-c-public/meta push git@git.frama-c.com:pub/meta origin/master:refs/heads/master
tags: tags:
- nix - nix
only: only:
- schedules - schedules
make_public_fclang: make_public_fclang:
stage: make_public stage: make_public
script: script:
- echo "$FRAMA_C_PUBLIC_SSH_PRIVATE_KEY" | nix run -f channel:nixos-19.03 coreutils --command base64 -d > nix/frama-c-public/id_ed25519 - echo "$FRAMA_C_PUBLIC_SSH_PRIVATE_KEY" | nix run -f channel:nixos-19.03 coreutils --command base64 -d > nix/frama-c-public/id_ed25519
- nix run -f channel:nixos-19.03 coreutils --command chmod 400 nix/frama-c-public/id_ed25519 - nix run -f channel:nixos-19.03 coreutils --command chmod 400 nix/frama-c-public/id_ed25519
- GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git clone git@git.frama-c.com:frama-c/frama-clang.git nix/frama-c-public/frama-clang - GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git clone git@git.frama-c.com:frama-c/frama-clang.git nix/frama-c-public/frama-clang
- GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git -C nix/frama-c-public/frama-clang push git@git.frama-c.com:pub/frama-clang origin/master:refs/heads/master - GIT_SSH=$PWD/nix/frama-c-public/ssh.sh nix run -f channel:nixos-19.03 openssh --command git -C nix/frama-c-public/frama-clang push git@git.frama-c.com:pub/frama-clang origin/master:refs/heads/master
tags: tags:
- nix - nix
only: only:
- schedules - schedules
...@@ -63,6 +63,8 @@ stdenv.mkDerivation rec { ...@@ -63,6 +63,8 @@ stdenv.mkDerivation rec {
python3 python3
]; ];
outputs = [ "out" "build_dir" ];
preConfigure = '' preConfigure = ''
autoconf autoconf
''; '';
...@@ -71,6 +73,12 @@ stdenv.mkDerivation rec { ...@@ -71,6 +73,12 @@ stdenv.mkDerivation rec {
"FRAMAC_INSTALLDIR=$(out)" "FRAMAC_INSTALLDIR=$(out)"
]; ];
postInstall = ''
mkdir -p $build_dir
tar -cf $build_dir/dir.tar .
pwd > $build_dir/old_pwd
'';
meta = { meta = {
description = "An extensible and collaborative platform dedicated to source-code analysis of C software"; description = "An extensible and collaborative platform dedicated to source-code analysis of C software";
homepage = "http://frama-c.com/"; homepage = "http://frama-c.com/";
......
{ lib
, stdenv
, frama-c
, perl
, time
, which
}:
stdenv.mkDerivation rec {
pname = "main-tests";
version = frama-c.version;
slang = frama-c.slang;
build_dir = frama-c.build_dir;
src = build_dir + "/dir.tar";
sourceRoot = ".";
buildInputs = frama-c.buildInputs ++ [
frama-c
perl
time
which
];
# Keep main configuration
configurePhase = ''
true
'';
buildPhase = ''
make ptests/ptests.exe
make ptests/wtests.exe
dune exec --root ptests -- frama-c-ptests tests
dune build --display short @tests/ptests
'';
# No installation required
installPhase = ''
touch $out
'';
}
...@@ -6,6 +6,7 @@ let ...@@ -6,6 +6,7 @@ let
# Builds # Builds
frama-c = oself.callPackage ./frama-c.nix {}; frama-c = oself.callPackage ./frama-c.nix {};
# Tests # Tests
main-tests = oself.callPackage ./main-tests.nix {};
}; };
overlay = self: super: { overlay = self: super: {
niv = (import sources.niv {}).niv; niv = (import sources.niv {}).niv;
......
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