From efd9f451ed26b86bed6674f096a2693ea95b548d Mon Sep 17 00:00:00 2001
From: Josh Wilson <joshuef@gmail.com>
Date: Thu, 30 Mar 2023 06:26:48 +0200
Subject: [PATCH] ci: remove duplicate run skipping

removes the pre_job check and related job deps
this was not at all stable and proving to be more
pain than it was worth
---
 .github/workflows/merge.yml | 67 ++++---------------------------------
 1 file changed, 6 insertions(+), 61 deletions(-)

diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml
index aa67a37085..4f13d31093 100644
--- a/.github/workflows/merge.yml
+++ b/.github/workflows/merge.yml
@@ -20,53 +20,6 @@ env:
   NODE_COUNT: 14
 
 jobs:
-  # make sure all the jobs are not failed.
-  # Note that the duplicated jobs might be skipped.
-  merge-after-tests:
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
-    name: Allow merge if all tests have passed
-    runs-on: ${{ matrix.os }}
-    strategy:
-      matrix:
-        os: [ubuntu-latest, windows-latest, macos-latest]
-    needs:
-      - unit
-      - e2e
-      - e2e-msg-happy-path
-      - api
-      - cli
-    steps:
-      - run: echo "All checks passed, ready to merge"
-
-  # make sure all the os agnostic specific jobs pass
-  # (those that are not os dependent, so we only run once)
-  merge-after-os-agnostic-only-tests:
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
-    name: Allow merge if all os-agnostic code quality checks pass
-    runs-on: ubuntu-latest
-    needs:
-      - cargo-udeps
-      - lint
-      - checks
-      - build-arm
-    steps:
-      - run: echo "All os agnostic checks passed, ready to merge"
-
-  pre_job:
-    # continue-on-error: true # Uncomment once integration is finished
-    runs-on: ubuntu-latest
-    # Map a step output to a job output
-    outputs:
-      should_skip: ${{ steps.skip_check.outputs.should_skip }}
-    steps:
-      - id: skip_check
-        uses: fkirc/skip-duplicate-actions@v5
-        with:
-          # All of these options are optional, so you can remove them if you are happy with the defaults
-          concurrent_skipping: 'never'
-          skip_after_successful_duplicate: 'true'
-          do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
-
   cargo-udeps:
     if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: Unused dependency check
@@ -142,8 +95,6 @@ jobs:
         run: RUSTDOCFLAGS="--deny=warnings" cargo doc --no-deps
 
   build-arm:
-    needs: pre_job
-    if: needs.pre_job.outputs.should_skip != 'true'
     name: build arm
     runs-on: ${{ matrix.os }}
     strategy:
@@ -175,8 +126,7 @@ jobs:
             !artifacts/.cargo-lock
 
   unit:
-    needs: pre_job
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):') && needs.pre_job.outputs.should_skip != 'true'"
+    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: Unit Tests
     runs-on: ${{ matrix.os }}
     strategy:
@@ -238,8 +188,7 @@ jobs:
         run: cd sn_cli && cargo test --release --bin safe --features data-network
 
   e2e:
-    needs: pre_job
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):') && needs.pre_job.outputs.should_skip != 'true'"
+    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: E2E tests
     runs-on: ${{ matrix.os }}
     strategy:
@@ -386,8 +335,7 @@ jobs:
         continue-on-error: true
 
   e2e-msg-happy-path:
-    needs: pre_job
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):') && needs.pre_job.outputs.should_skip != 'true'"
+    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: E2E tests (msg happy path)
     runs-on: ${{ matrix.os }}
     strategy:
@@ -534,8 +482,7 @@ jobs:
         continue-on-error: true
 
   e2e-churn:
-    needs: pre_job
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):') && needs.pre_job.outputs.should_skip != 'true'"
+    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: E2E Churn test
     runs-on: ubuntu-latest
     env:
@@ -787,8 +734,7 @@ jobs:
   #         rm -rf ~/.safe
 
   api:
-    needs: pre_job
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):') && needs.pre_job.outputs.should_skip != 'true'"
+    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: Run API tests
     runs-on: ${{ matrix.os }}
     strategy:
@@ -919,8 +865,7 @@ jobs:
         continue-on-error: true
 
   cli:
-    needs: pre_job
-    if: "!startsWith(github.event.head_commit.message, 'chore(release):') && needs.pre_job.outputs.should_skip != 'true'"
+    if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
     name: Run CLI tests
     runs-on: ${{ matrix.os }}
     strategy: