Skip to content

Commit 2a41345

Browse files
committed
Migrate CircleCI to Buildkite
- Use Nixkite to define a Buildkite pipeline in Nix. - Modify the "test-ets.sh" script to reflect the new Buildkite environment. - Remove old CircleCI config. - Update the solidity compiler to version 0.5.1 because that's the version currently available in the Nix environment.
1 parent 02fc7f6 commit 2a41345

21 files changed

+200
-279
lines changed

.buildkite/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import (import ../nix/sources.nix).nixkite

.buildkite/pipeline.nix

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{ cfg, pkgs, ... }:
2+
3+
with cfg.steps.commands;
4+
5+
let
6+
commonAttrs = {
7+
retry.automatic = true;
8+
agents.queue = "project42";
9+
};
10+
in
11+
12+
{
13+
steps.commands = {
14+
compile = commonAttrs // {
15+
label = "compile everything";
16+
command = ''
17+
nix-shell --run '$SBT compile-all'
18+
'';
19+
};
20+
21+
style = commonAttrs // {
22+
dependsOn = [ compile ];
23+
label = "scalastyle";
24+
command = ''
25+
nix-shell --run '$SBT scalastyle test:scalastyle'
26+
'';
27+
};
28+
29+
test-unit = commonAttrs // {
30+
dependsOn = [ compile ];
31+
label = "unit tests";
32+
command = ''
33+
nix-shell --run '$SBT coverage test'
34+
'';
35+
artifactPaths = [
36+
"target/test-reports/**/*"
37+
"target/scala/2.12/scoverage-report/**/*"
38+
"target/scala/2.12/coverage-report/**/*"
39+
];
40+
};
41+
42+
test-evm = commonAttrs // {
43+
dependsOn = [ compile ];
44+
label = "EVM tests";
45+
command = ''
46+
nix-shell --run '$SBT coverage evm:test'
47+
'';
48+
artifactPaths = [
49+
"target/test-reports/**/*"
50+
"target/scala/2.12/scoverage-report/**/*"
51+
"target/scala/2.12/coverage-report/**/*"
52+
];
53+
};
54+
55+
test-integration = commonAttrs // {
56+
dependsOn = [ compile ];
57+
label = "integration tests";
58+
command = ''
59+
nix-shell --run '$SBT coverageOff it:test'
60+
'';
61+
artifactPaths = [ "target/test-reports/**/*" ];
62+
};
63+
64+
test-ets = commonAttrs // {
65+
dependsOn = [ compile ];
66+
label = "ETS";
67+
command = ''
68+
nix-shell --run './test-ets.sh'
69+
'';
70+
};
71+
72+
coverageReport = commonAttrs // {
73+
dependsOn = [ test-unit test-evm ];
74+
label = "coverage report";
75+
command = ''
76+
nix-shell --run '$SBT coverageReport coverageAggregate'
77+
'';
78+
};
79+
80+
additional = commonAttrs // {
81+
dependsOn = [ compile ];
82+
label = "additional compilation & dist";
83+
command = ''
84+
nix-shell --run '$SBT benchmark:compile snappy:compile dist'
85+
'';
86+
};
87+
};
88+
}

.buildkite/pipeline.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
steps:
2+
- label: ":nix::point_right::pipeline:"
3+
command: |
4+
export NIX_PATH="nixpkgs=$(nix eval --raw '(import nix/sources.nix).nixpkgs')"
5+
nix eval --json '(import ./.buildkite { pipeline = ./.buildkite/pipeline.nix; })' \
6+
| buildkite-agent pipeline upload --no-interpolation
7+
agents:
8+
queue: project42

.buildkite/shell.nix

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{ pkgs }:
2+
3+
let
4+
5+
# TODO, share this code with mantis build in this project
6+
# sbt-protoc puts the scala plugin in /tmp/protobridge<some-random-number>.
7+
# it is in fact a shell script with a standard `#!/usr/bin/env sh` shebang
8+
# that makes the Nix sandbox ANGRY and breaks all the things in a cryptic,
9+
# hairpull-inducing way. So we gotta sed it out. Not the prettiest thing
10+
# but it works.
11+
protoc-wrapper = pkgs.writeShellScriptBin "protoc" ''
12+
set -e
13+
14+
for f in "$@"; do
15+
echo ''${f##*=}
16+
done | grep protocbridge | xargs sed -i "1s|.*|#!${pkgs.bash}/bin/bash|"
17+
18+
exec ${pkgs.protobuf}/bin/protoc "$@"
19+
'';
20+
21+
in
22+
23+
with pkgs;
24+
25+
mkShell {
26+
27+
buildInputs = [ sbt solc jdk8 protoc-wrapper ];
28+
# SBT = "sbt -v -mem 2048 -J-Xmx4g -Dsbt.ivy.home=/cache/ivy2 -Dsbt.boot.directory=/cache/sbt -Dmaven.repo.local=/cache/maven -Dnix=true";
29+
SBT = "sbt -v -mem 2048 -J-Xmx4g -Dnix=true";
30+
}

.circleci/Dockerfile

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

.circleci/config.yml

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

nix/sources.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
"url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz",
3636
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737
},
38+
"nixkite": {
39+
"branch": "master",
40+
"description": "Nixkite is a Buildkite pipeline generation tool using the NixOS module system",
41+
"homepage": null,
42+
"owner": "input-output-hk",
43+
"repo": "nixkite",
44+
"rev": "11c40d1591e294a2da275aaeb9e21a45319a4673",
45+
"sha256": "1cfiqv4n54g9xkm5zvypxfrr8ajpbggvpjn6dp1l9kfc2aknpgiz",
46+
"type": "tarball",
47+
"url": "https://github.com/input-output-hk/nixkite/archive/11c40d1591e294a2da275aaeb9e21a45319a4673.tar.gz",
48+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
49+
},
3850
"nixpkgs": {
3951
"branch": "nixos-20.03",
4052
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",

project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ object Dependencies {
9797
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.1.0",
9898
"com.google.guava" % "guava" % "29.0-jre",
9999
"org.xerial.snappy" % "snappy-java" % "1.1.7.7",
100-
"org.web3j" % "core" % "5.0.0" % Test
100+
"org.web3j" % "core" % "3.4.0" % Test
101101
)
102102

103103
val prometheus: Seq[ModuleID] = {

0 commit comments

Comments
 (0)