From 925671c66e8ed76a4dbe593b603beb5c4839c1b3 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 13 Jun 2022 12:38:17 -0400
Subject: [PATCH] Switch from stage-based to workflow-based in CI configuration

---
 .gitlab-ci.yml | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4494a165..0f9bf503 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,12 @@
+workflow:
+  rules:
+    # If the pipeline is triggered by a merge request event then we should
+    # run.
+    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+
+    # If the pipeline is triggered by anything else then we should not run.
+    - when: "never"
+
 default:
   # Guide the choice of an appropriate runner for all these jobs.
   # https://docs.gitlab.com/ee/ci/runners/#runner-runs-only-tagged-jobs
@@ -10,7 +19,6 @@ variables:
   GET_SOURCES_ATTEMPTS: 10
 
 docs:
-  stage: "build"
   script:
     - "nix-build --attr docs --out-link result-docs"
     # GitLab wants to lchown artifacts.  It can't do that to store paths.  Get
@@ -22,12 +30,10 @@ docs:
     expose_as: "documentation"
 
 unit-tests:
-  stage: "test"
   script:
     - "nix-build --attr unit-tests && cat result"
 
 .morph-build: &MORPH_BUILD
-  stage: "test"
   timeout: "3 hours"
 
   script:
@@ -60,7 +66,6 @@ morph-build-production:
 
 
 vulnerability-scan:
-  stage: "test"
   script:
     - "ci-tools/vulnerability-scan security-report.json"
     - "ci-tools/count-vulnerabilities <security-report.json"
@@ -71,14 +76,12 @@ vulnerability-scan:
 
 
 system-tests:
-  stage: "test"
   timeout: "3 hours"
   script:
     - "nix-build --attr system-tests"
 
 # A template for a job that can update one of the grids.
 .update-grid: &UPDATE_GRID
-  stage: "deploy"
   script: |
     env --ignore-environment - \
       NIX_PATH="$NIX_PATH" \
-- 
GitLab