From 6142212035dc47a298d8166589d589b153618e0d Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Mon, 8 Apr 2024 01:00:48 +0100 Subject: [PATCH] ci: only run Wasm tests once a PR reaches the merge queue The Wasm tests are very expensive, and our build system isn't smart enough to know when they don't need to be re-run, so for now, we only run the tests once a PR hits the merge queue. Signed-off-by: Drew Hess --- .buildkite/primer-wasm.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.buildkite/primer-wasm.yaml b/.buildkite/primer-wasm.yaml index 6eebfce21..5763f1670 100644 --- a/.buildkite/primer-wasm.yaml +++ b/.buildkite/primer-wasm.yaml @@ -1,10 +1,30 @@ +# Note: because they take so much time to run, we only run the Primer +# Wasm tests when one of these conditions is true: +# +# 1. The PR has hit the merge queue. +# 2. The PR has the "Run Wasm tests" label. + agents: queue: "nix-build" os: "linux" steps: - - label: ":haskell: :linux: Primer Wasm targets" + # Note: only one of these should run during any given build. + # Unfortunately, Buildkite doesn't support if-else conditionals, so + # this gets a bit tricky. + + - label: ":haskell: :linux: Primer Wasm tests" + if: | + build.branch =~ /^gh-readonly-queue\// || + build.pull_request.labels includes "Run Wasm tests" command: | nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 update - nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 test + + - label: ":haskell: :linux: Primer Wasm build" + if: | + build.branch !~ /^gh-readonly-queue\// && + !(build.pull_request.labels includes "Run Wasm tests") + command: | + nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 update + nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32