Skip to content

Commit b45e8ba

Browse files
Baltoliehildenb
andauthored
Migrate Jenkins to Github actions (#595)
* Initial version parameter * Run all configs * Update default.nix * Flake tests in CI * Run a subset of tests * Reduce? * Increase * GC? * Opt in to self-hosting * No nix? * Reduce size * Cut tests in Jenkins * Make flake default for tests * Tidy up * Test logs * Even smaller Co-authored-by: Everett Hildenbrandt <[email protected]>
1 parent 54e410a commit b45e8ba

File tree

9 files changed

+64
-175
lines changed

9 files changed

+64
-175
lines changed

.github/workflows/test-flake.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ jobs:
4343

4444
- name: 'Build LLVM backend'
4545
run: GC_DONT_GC=1 nix build .
46+
47+
- name: 'Test LLVM backend'
48+
run: GC_DONT_GC=1 nix flake check --print-build-logs

.github/workflows/test.yml

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

Jenkinsfile

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,6 @@ pipeline {
44
ansiColor('xterm')
55
}
66
stages {
7-
stage("Init title") {
8-
when { changeRequest() }
9-
steps { script { currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}" } }
10-
}
11-
stage('Build and test Arch Linux') {
12-
agent {
13-
dockerfile {
14-
filename 'Dockerfile.arch'
15-
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --pull'
16-
}
17-
}
18-
options { timeout(time: 30, unit: 'MINUTES') }
19-
steps {
20-
sh '''
21-
./ciscript Debug
22-
./ciscript Release
23-
./ciscript RelWithDebInfo
24-
./ciscript FastBuild
25-
./ciscript GcStats
26-
'''
27-
}
28-
}
29-
stage('Build and test Ubuntu Focal') {
30-
agent {
31-
dockerfile {
32-
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg BASE_IMAGE=ubuntu:focal --build-arg LLVM_VERSION=10'
33-
reuseNode true
34-
}
35-
}
36-
options { timeout(time: 30, unit: 'MINUTES') }
37-
steps {
38-
sh '''
39-
./ciscript Debug
40-
./ciscript Release
41-
./ciscript RelWithDebInfo
42-
./ciscript FastBuild
43-
./ciscript GcStats
44-
'''
45-
}
46-
}
47-
stage('Build and test Ubuntu Jammy') {
48-
agent {
49-
dockerfile {
50-
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg BASE_IMAGE=ubuntu:jammy --build-arg LLVM_VERSION=14'
51-
reuseNode true
52-
}
53-
}
54-
options { timeout(time: 30, unit: 'MINUTES') }
55-
steps {
56-
sh '''
57-
./ciscript Debug
58-
./ciscript Release
59-
./ciscript RelWithDebInfo
60-
./ciscript FastBuild
61-
./ciscript GcStats
62-
'''
63-
}
64-
}
657
stage('Update K Submodule') {
668
when { branch 'master' }
679
agent {

ciscript

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

default.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ in { pkgs ? pinned
2222

2323
# Build an optimized release package.
2424
# Currently requires dependents to use LTO. Use sparingly.
25-
, release ? false }:
25+
, cmakeBuildType ? "FastBuild" }:
2626

2727
let
2828
localOverlay = import ./nix/overlay.nix;
@@ -36,7 +36,8 @@ let
3636
# Avoid spurious rebuilds by ignoring files that don't affect the build.
3737
mavenix = import sources."mavenix" { inherit (prev) pkgs; };
3838
in {
39-
llvm-backend-release = release;
39+
llvm-version = 13;
40+
llvm-backend-build-type = cmakeBuildType;
4041
inherit (mavenix) buildMaven;
4142
mavenix-cli = mavenix.cli;
4243

flake.lock

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
inputs = {
55
utils.url = "github:numtide/flake-utils";
6-
# locked due to https://github.com/NixOS/nixpkgs/pull/172397/files
7-
nixpkgs.url =
8-
"github:nixos/nixpkgs/a923e194a3f21ed8a31367c96530a06756ed993e";
6+
nixpkgs.url = "github:nixos/nixpkgs";
97
immer-src.url =
108
"github:runtimeverification/immer/198c2ae260d49ef1800a2fe4433e07d7dec20059";
119
immer-src.flake = false;
@@ -20,6 +18,8 @@
2018

2119
outputs = { self, nixpkgs, utils, immer-src, rapidjson-src, pybind11-src, mavenix }:
2220
let
21+
inherit (nixpkgs) lib;
22+
2323
# put devShell and any other required packages into local overlay
2424
# if you have additional overlays, you may add them here
2525
localOverlay = import ./nix/overlay.nix; # this should expose devShell
@@ -64,10 +64,13 @@
6464
llvm-backend-overlay =
6565
nixpkgs.lib.composeManyExtensions [ depsOverlay localOverlay ];
6666

67-
pkgsForSystem = system: llvm-backend-release:
67+
pkgsForSystem = system: llvm-version: llvm-backend-build-type:
6868
import nixpkgs {
6969
overlays = [
70-
(_: _: { inherit llvm-backend-release; })
70+
(_: _: {
71+
inherit llvm-version;
72+
inherit llvm-backend-build-type;
73+
})
7174
mavenix.overlay
7275
llvm-backend-overlay
7376
];
@@ -80,16 +83,50 @@
8083
"aarch64-darwin"
8184
] (system:
8285
let
83-
packagesRelease = pkgsForSystem system true;
84-
packages = pkgsForSystem system false;
85-
in {
86+
listToChecks = checks:
87+
builtins.listToAttrs (lib.imap0 (i: v: { name = "check_${toString i}"; value = v; }) checks);
88+
89+
matrix = builtins.listToAttrs (lib.forEach (lib.cartesianProductOfSets {
90+
llvm-version = [12 13 14];
91+
build-type = ["Debug" "Release" "RelWithDebInfo" "FastBuild" "GcStats"];
92+
}) (
93+
args:
94+
let pkgs = pkgsForSystem system args.llvm-version args.build-type; in
95+
{
96+
name = "llvm-backend-${toString args.llvm-version}-${args.build-type}";
97+
value = {
98+
inherit (pkgs) llvm-backend llvm-backend-matching integration-tests devShell;
99+
};
100+
}
101+
));
102+
in with matrix; {
86103
packages = utils.lib.flattenTree {
87-
inherit (packages) llvm-backend llvm-backend-matching;
88-
llvm-backend-release = packagesRelease.llvm-backend;
89-
default = packages.llvm-backend;
104+
inherit (llvm-backend-14-FastBuild) llvm-backend llvm-backend-matching;
105+
default = llvm-backend-14-FastBuild.llvm-backend;
106+
llvm-backend-release = llvm-backend-14-Release.llvm-backend;
90107
};
91-
checks = { inherit (packages) integration-tests; };
92-
devShells.default = packages.devShell;
108+
checks = listToChecks [
109+
# Check that the backend compiles on each supported version of LLVM,
110+
# but don't run the test suite on all 15 configurations.
111+
112+
# Disable the full set temporarily while the checks run on a hosted
113+
# runner.
114+
# llvm-backend-12-Debug.llvm-backend
115+
llvm-backend-12-FastBuild.llvm-backend
116+
117+
# llvm-backend-13-Debug.llvm-backend
118+
llvm-backend-13-FastBuild.llvm-backend
119+
120+
# llvm-backend-14-Debug.integration-tests
121+
# llvm-backend-14-Release.integration-tests
122+
123+
# llvm-backend-14-RelWithDebInfo.integration-tests
124+
# llvm-backend-14-FastBuild.integration-tests
125+
# llvm-backend-14-GcStats.integration-tests
126+
127+
llvm-backend-14-FastBuild.integration-tests
128+
];
129+
devShells.default = llvm-backend-14-FastBuild.devShell;
93130
}) // {
94131
# non-system suffixed items should go here
95132
overlays.default = llvm-backend-overlay;

nix/llvm-backend.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# Runtime dependencies:
44
host,
55
# Options:
6-
release ? false # optimized release build, currently: LTO
6+
cmakeBuildType ? "FastBuild" # optimized release build, currently: LTO
77
}:
88
stdenv.mkDerivation {
99
pname = "llvm-backend";
1010
version = "0";
11-
inherit src;
11+
inherit src cmakeBuildType;
1212

1313
nativeBuildInputs = [ cmake flex llvm pkgconfig python3 ];
1414
buildInputs = [ boost libyaml ];
@@ -41,11 +41,9 @@ stdenv.mkDerivation {
4141
"-DUSE_NIX=TRUE"
4242
"-DCMAKE_SKIP_BUILD_RPATH=FALSE"
4343
"-DBUILD_TESTS=True"
44-
"-DK_LLVM_BACKEND_LTO=${if isArmMac then "OFF" else "ON"}"
44+
"-DK_LLVM_BACKEND_LTO=OFF"
4545
];
4646

47-
cmakeBuildType = if release then "Release" else "FastBuild";
48-
4947
NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
5048

5149
doCheck = true;

nix/overlay.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
final: prev:
22
let
3-
llvmPackages = prev.llvmPackages_13.override {
3+
llvmPackages = prev."llvmPackages_${toString prev.llvm-version}".override {
44
bootBintoolsNoLibc = null;
55
bootBintools = null;
66
};
@@ -32,7 +32,7 @@ let
3232
llvmPackages.stdenv
3333
else
3434
prev.overrideCC llvmPackages.stdenv clang;
35-
release = prev.llvm-backend-release;
35+
cmakeBuildType = prev.llvm-backend-build-type;
3636
src = prev.llvm-backend-src;
3737
inherit jemalloc;
3838
host.clang = clang;

0 commit comments

Comments
 (0)