From 80c860dad9956cb0e22d0778cd4f97da397b89d6 Mon Sep 17 00:00:00 2001 From: ApolloBot2 Date: Fri, 12 Jul 2024 11:39:39 -0500 Subject: [PATCH] update circle to block for github action --- .circleci/config.yml | 45 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5019e8b9b..d68c0241d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,7 +67,6 @@ workflows: rust_channel: [stable] command: [test] <<: *any_release - - xtask: name: Build and bundle release artifacts (<< matrix.platform >>) matrix: @@ -83,6 +82,12 @@ workflows: - "Run cargo tests (stable rust on amd_windows)" <<: *composition_release + - check_for_github_action: + name: Check to ensure Github Action has completed successfully (<< matrix.platform >>) + requires: + - "Run cargo tests (stable rust on amd_macos)" + <<: *any_release + - publish_release: name: Publish to crates.io and create a GitHub release matrix: @@ -94,6 +99,7 @@ workflows: - "Build and bundle release artifacts (amd_macos)" - "Build and bundle release artifacts (arm_macos)" - "Build and bundle release artifacts (amd_windows)" + - "Check to ensure Github Action has completed successfully (amd_macos)" <<: *composition_release - publish_release: @@ -178,6 +184,14 @@ jobs: platform: << parameters.platform >> command: publish - gh_release + + check_for_github_action: + parameters: + platform: + type: executor + executor: << parameters.platform >> + steps: + - run_check_for_github_action # The machines we use to run our workflows on executors: @@ -490,3 +504,32 @@ commands: Binaries built for MacOS are signed, notarized, and automatically verified with [Gatekeeper](https://support.apple.com/guide/deployment-reference-macos/using-gatekeeper-apd02b925e38/web).' \ artifacts/* + + run_check_for_github_action: + steps: + - run: + name: Check Intel Mac test completed successfully + command: | + max_attempts=40 + attempt=0 + while [ $attempt -lt $max_attempts ]; do + RESULT=`curl -s -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/apollographql/federation-rs/actions/runs?head_sha=db7d52a27138fcfb9449176cd9d8bb804cf57e60" | jq -r '.workflow_runs[].conclusion'` + + echo "Attempt $((attempt+1)) of $max_attempts: RESULT is $RESULT" + + if [ "$RESULT" == "success" ]; then + echo "Success condition met." + exit 0 # Success exit code + elif [ "$RESULT" == "failure" ]; then + echo "Failure condition detected." + exit 1 # Failure exit code + fi + + attempt=$((attempt + 1)) + sleep 15 # Wait for 15 seconds before the next check + done + + echo "Maximum attempts reached without success." + exit 1 # Indicates failure to meet success condition within the allowed attempts \ No newline at end of file