From 9325c94a707e6067cf4f259d93ed817fd07da280 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 11 Mar 2021 16:31:47 +0100 Subject: [PATCH 1/7] Add ci configuration to .bazelrc --- .bazelrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.bazelrc b/.bazelrc index 687c13626..0911030ab 100644 --- a/.bazelrc +++ b/.bazelrc @@ -5,3 +5,18 @@ build --crosstool_top=@nixpkgs_config_cc//:toolchain # resolved before `--incompatible_enable_cc_toolchain_resolution` can be # recommended for `nixpkgs_cc_configure_hermetic`. # build --incompatible_enable_cc_toolchain_resolution + +# CI Configuration +# ---------------- +common:ci --color=no +build:ci --verbose_failures +test:ci --test_output=errors + +# Use a remote cache during CI +build:ci --bes_results_url=https://app.buildbuddy.io/invocation/ +build:ci --bes_backend=grpcs://cloud.buildbuddy.io +build:ci --remote_cache=grpcs://cloud.buildbuddy.io +build:ci --remote_timeout=3600 +# Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`. +# See https://github.com/tweag/rules_haskell/issues/1498. +build:ci --keep_backend_build_event_connections_alive=false From 8e45d95c6b661e0ea88f40e235f223c837e9c9de Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 11 Mar 2021 17:04:10 +0100 Subject: [PATCH 2/7] Import .bazelrc.local --- .bazelrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bazelrc b/.bazelrc index 0911030ab..035d9bfa6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -20,3 +20,7 @@ build:ci --remote_timeout=3600 # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`. # See https://github.com/tweag/rules_haskell/issues/1498. build:ci --keep_backend_build_event_connections_alive=false + +# User Configuration +# ------------------ +try-import %workspace%/.bazelrc.local From 9cf1dd5d59666aec07dd9929901df577b1e5a9dd Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 11 Mar 2021 16:31:57 +0100 Subject: [PATCH 3/7] Define GitHub actions workflow --- .github/workflows/workflow.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/workflow.yaml diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml new file mode 100644 index 000000000..a5aa4bd08 --- /dev/null +++ b/.github/workflows/workflow.yaml @@ -0,0 +1,29 @@ +name: Continuous integration +on: [push] +jobs: + test-nixpkgs: + name: Build & Test - Nixpkgs + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos] + runs-on: ${{ matrix.os }}-latest + steps: + - uses: actions/checkout@v2 + - uses: cachix/install-nix-action@v12 + with: + nix_path: nixpkgs=./nixpkgs.nix + - name: Configure + env: + BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }} + run: | + cat >.bazelrc.local < Date: Thu, 11 Mar 2021 16:32:37 +0100 Subject: [PATCH 4/7] Remove the buildkite pipeline --- .buildkite/pipeline.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .buildkite/pipeline.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index d104ca7df..000000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,5 +0,0 @@ -steps: - - label: "Run tests" - command: | - nix-shell --pure --run 'bazel test --test_output errors //...' - timeout: 100 From 6637cfa003daff0b44d1d980b1f61abce91cadcb Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 11 Mar 2021 16:33:39 +0100 Subject: [PATCH 5/7] Update Mergify configuration --- .mergify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index 9a924a877..dbf2238d6 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,7 +1,8 @@ pull_request_rules: - name: automatic merge conditions: - - "status-success~=buildkite/rules-nixpkgs(|/pr)" + - 'status-success~=Build & Test - Nixpkgs \(ubuntu\).*' + - 'status-success~=Build & Test - Nixpkgs \(macos\).*' - "#approved-reviews-by>=1" - "label=merge-queue" - "base=master" @@ -25,4 +26,3 @@ pull_request_rules: label: remove: - "merge-queue" - From 708d867ba075f917520c21022559c7b1794e0471 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 11 Mar 2021 16:50:59 +0100 Subject: [PATCH 6/7] Skip busybox test on Darwin --- tests/BUILD.bazel | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 6c80584fd..5b5e06e56 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -128,7 +128,12 @@ sh_test( data = [ "//nixpkgs:srcs", "//tests/invalid_nixpkgs_package:srcs", - "@busybox_static//:bin", "@nix-unstable//:bin", + ] + select({ + "@platforms//os:linux": ["@busybox_static//:bin"], + "//conditions:default": [], + }), + target_compatible_with = [ + "@platforms//os:linux", ], ) From a854667d356cac930abb8967c9840b3df66c15ea Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 11 Mar 2021 18:12:18 +0100 Subject: [PATCH 7/7] Add comment explaining why busybox is disabled --- tests/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 5b5e06e56..30210a829 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -134,6 +134,7 @@ sh_test( "//conditions:default": [], }), target_compatible_with = [ + # busybox_static is not available on MacOS. "@platforms//os:linux", ], )