Skip to content

Commit

Permalink
update circle to block for github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ApolloBot2 committed Jul 12, 2024
1 parent ea99489 commit 80c860d
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ workflows:
rust_channel: [stable]
command: [test]
<<: *any_release

- xtask:
name: Build and bundle release artifacts (<< matrix.platform >>)
matrix:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 80c860d

Please sign in to comment.