Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildkite: rust job #5192

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildkite/Makefile
Expand Up @@ -4,4 +4,4 @@ check:
dhall --file './src/Monorepo.dhall'
# globstar doesn't work on macOS bash :facepalm:, so we can't glob
# xargs will short-circuit if a command fails with code 255
find ./src/Jobs/ -name "Pipeline.dhall" -print0 | xargs -I{} -0 -n1 bash -c 'dhall --file {} || exit 255'
find ./src/Jobs/ -name "*.dhall" -print0 | xargs -I{} -0 -n1 bash -c 'dhall --file {} || exit 255'
39 changes: 39 additions & 0 deletions buildkite/src/Jobs/CheckDhall.dhall
@@ -0,0 +1,39 @@
let S = ../Lib/SelectFiles.dhall
let D = S.PathPattern

let JobSpec = ../Pipeline/JobSpec.dhall
let Pipeline = ../Pipeline/Dsl.dhall
let Command = ../Command/Base.dhall
let Docker = ../Command/Docker/Type.dhall
let Size = ../Command/Size.dhall

let Cmd = ../Lib/Cmds.dhall

in

Pipeline.build
Pipeline.Config::{
spec = JobSpec::{
dirtyWhen = [
S.strictly (S::{
dir = Some [D.Lit "buildkite/", D.Any],
exts = Some ["dhall"]
}),
S.strictly (S.contains "buildkite/Makefile"),
S.exactly "buildkite/scripts/generate-jobs" "sh"
],
name = "CheckDhall"
},
steps = [
Command.build
Command.Config::{
commands = [
Cmd.run "cd buildkite && make check"
],
label = "Check all CI Dhall entrypoints",
key = "check",
target = Size.Small,
docker = Some Docker::{ image = (../Constants/ContainerImages.dhall).toolchainBase }
}
]
}
17 changes: 0 additions & 17 deletions buildkite/src/Jobs/CheckDhall/Spec.dhall

This file was deleted.

52 changes: 52 additions & 0 deletions buildkite/src/Jobs/ClientSdk.dhall
@@ -0,0 +1,52 @@
let Prelude = ../External/Prelude.dhall
let S = ../Lib/SelectFiles.dhall

let Cmd = ../Lib/Cmds.dhall

let Pipeline = ../Pipeline/Dsl.dhall
let Command = ../Command/Base.dhall
let OpamInit = ../Command/OpamInit.dhall
let Docker = ../Command/Docker/Type.dhall
let Size = ../Command/Size.dhall
let JobSpec = ../Pipeline/JobSpec.dhall

in

Pipeline.build
Pipeline.Config::{
spec =
let opamDirtyWhen = [
S.exactly "src/opam" "export",
S.exactly "scripts/setup-opam" "sh",
S.strictly (S.contains "Makefile")
]
in
JobSpec::{
dirtyWhen = opamDirtyWhen # [
S.strictlyStart (S.contains "buildkite/src/Jobs/ClientSdk"),
S.strictlyStart (S.contains "src")
],
name = "ClientSdk"
},
steps = [
Command.build
Command.Config::{
commands = OpamInit.commands # [
Cmd.runInDocker
Cmd.Docker::{
image = (../../Constants/ContainerImages.dhall).codaToolchain
}
("mkdir -p /tmp/artifacts && (" ++
"set -o pipefail ; " ++
"./buildkite/scripts/opam-env.sh && " ++
"make client_sdk 2>&1 | tee /tmp/artifacts/buildclientsdk.log" ++
")")
],
label = "Build client-sdk",
key = "build-client-sdk",
target = Size.Large,
docker = None Docker.Type
}
]
}

38 changes: 0 additions & 38 deletions buildkite/src/Jobs/ClientSdk/Pipeline.dhall

This file was deleted.

18 changes: 0 additions & 18 deletions buildkite/src/Jobs/ClientSdk/Spec.dhall

This file was deleted.

40 changes: 40 additions & 0 deletions buildkite/src/Jobs/Lint/Fast.dhall
@@ -0,0 +1,40 @@
let Prelude = ../../External/Prelude.dhall

let S = ../../Lib/SelectFiles.dhall
let Cmd = ../../Lib/Cmds.dhall

let Pipeline = ../../Pipeline/Dsl.dhall
let Command = ../../Command/Base.dhall
let Docker = ../../Command/Docker/Type.dhall
let Size = ../../Command/Size.dhall
let JobSpec = ../../Pipeline/JobSpec.dhall

let commands =
[
Cmd.run "./scripts/lint_codeowners.sh",
Cmd.run "./scripts/lint_rfcs.sh",
Cmd.run "make check-snarky-submodule",
Cmd.run "./scripts/lint_preprocessor_deps.sh"
]

in

Pipeline.build
Pipeline.Config::{
spec = JobSpec::{
dirtyWhen = [ S.everything ],
path = "Lint",
name = "Fast"
},
steps = [
Command.build
Command.Config::{
commands = commands,
label = "Fast lint steps; CODEOWNERs, RFCs, Check Snarky Submodule, Preprocessor Deps",
key = "lint",
target = Size.Small,
docker = Some Docker::{ image = (../../Constants/ContainerImages.dhall).toolchainBase }
}
]
}

35 changes: 0 additions & 35 deletions buildkite/src/Jobs/Lint/Fast/Pipeline.dhall

This file was deleted.

10 changes: 0 additions & 10 deletions buildkite/src/Jobs/Lint/Fast/Spec.dhall

This file was deleted.

44 changes: 44 additions & 0 deletions buildkite/src/Jobs/Lint/OCaml.dhall
@@ -0,0 +1,44 @@
let Prelude = ../../External/Prelude.dhall

let S = ../../Lib/SelectFiles.dhall
let JobSpec = ../../Pipeline/JobSpec.dhall

let Cmd = ../../Lib/Cmds.dhall

let Pipeline = ../../Pipeline/Dsl.dhall
let Command/Coda = ../../Command/Coda.dhall
let Docker = ../../Command/Docker/Type.dhall
let Size = ../../Command/Size.dhall

let commands =
[
Cmd.run "eval $$(opam config env) && make check-format",
Cmd.run "./scripts/require-ppx-version.py"
]
in

Pipeline.build
Pipeline.Config::{
spec =
let
dirtyDhallDir = S.strictlyStart (S.contains "buildkite/src/Jobs/Lint/OCaml")
let
dirtyDhallDirCompiles = assert : S.compile [dirtyDhallDir] === "^buildkite/src/Jobs/Lint/OCaml"
in
JobSpec::{
dirtyWhen = [
dirtyDhallDir,
S.strictlyStart (S.contains "src/")
],
path = "Lint",
name = "OCaml"
},
steps = [
Command/Coda.build
Command/Coda.Config::{
commands = commands,
label = "OCaml Lints; Check-format, Require-ppx-version",
key = "check"
}
]
}
28 changes: 0 additions & 28 deletions buildkite/src/Jobs/Lint/OCaml/Pipeline.dhall

This file was deleted.

17 changes: 0 additions & 17 deletions buildkite/src/Jobs/Lint/OCaml/Spec.dhall

This file was deleted.

@@ -1,25 +1,30 @@
let Prelude = ../../External/Prelude.dhall

let S = ../../Lib/SelectFiles.dhall
let Cmd = ../../Lib/Cmds.dhall

let Pipeline = ../../Pipeline/Dsl.dhall
let Command = ../../Command/Base.dhall
let Docker = ../../Command/Docker/Type.dhall
let Size = ../../Command/Size.dhall

let Cmd = ../../Lib/Cmds.dhall

in
let JobSpec = ../../Pipeline/JobSpec.dhall

Pipeline.build
Pipeline.Config::{
spec = ./Spec.dhall,
spec = JobSpec::{
dirtyWhen = [ S.contains "src/app/trace-tool" ],
path = "Lint",
name = "Rust"
},
steps = [
Command.build
Command.Config::{
commands = [
Cmd.run "cd buildkite && make check"
],
label = "Check all CI Dhall entrypoints",
key = "check",
commands = [ Cmd.run "cd src/app/trace-tool ; cargo check --frozen" ],
label = "Rust lint steps",
key = "lint",
target = Size.Small,
docker = Some Docker::{ image = (../../Constants/ContainerImages.dhall).toolchainBase }
}
]
}