forked from pulp-platform/axi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'github/master'
- Loading branch information
Showing
77 changed files
with
10,272 additions
and
1,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,22 @@ | ||
name: Retrieve CI result from GitLab | ||
name: Internal CI | ||
on: | ||
push: | ||
branches-ignore: | ||
- gh-pages # deployment target branch (this workflow should not exist on that branch anyway) | ||
- v** # such branch names conflict with tags | ||
pull_request: | ||
branches-ignore: | ||
- gh-pages # deployment target branch (this workflow should not exist on that branch anyway) | ||
- v** # such branch names conflict with tags | ||
workflow_dispatch: | ||
|
||
jobs: | ||
gitlab-ci: | ||
if: github.repository == 'pulp-platform/axi' # do not run this job on forks (because Gitlab CI | ||
runs-on: ubuntu-latest # will not trigger on forks) | ||
timeout-minutes: 190 | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 310 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Check Gitlab CI | ||
uses: pulp-platform/pulp-actions/gitlab-ci@v2 | ||
# Skip on forks or pull requests from forks due to missing secrets. | ||
if: github.repository == 'pulp-platform/axi' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) | ||
with: | ||
persist-credentials: false | ||
# Checkout pull request HEAD commit instead of merge commit, because CI runs against HEAD | ||
# commit. | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Wait for synchronization (every 5 minutes) | ||
run: | | ||
while [ $(($(date -d "+1 minute" +%-M) % 5)) -ne 0 ]; do | ||
# "+1 minute" because if the current minute is divisible by 5, we likely already missed | ||
# the synchronization. | ||
sleep 10 | ||
done | ||
sleep 90 # the minute above plus 30 seconds to leave some time for the synchronization | ||
shell: bash | ||
|
||
- name: Obtain CI result | ||
run: | | ||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then | ||
BRANCH_NAME="$GITHUB_HEAD_REF" | ||
elif [ "$GITHUB_EVENT_NAME" == "push" ]; then | ||
if echo $GITHUB_REF | grep -qE '^refs/heads'; then | ||
BRANCH_NAME="$(echo $GITHUB_REF | cut -d '/' -f3-)" | ||
else | ||
echo "Error: Could not derive branch name from ref '$GITHUB_REF'!" | ||
exit 1 | ||
fi | ||
else | ||
echo "Error: Unsupported event: '$GITHUB_EVENT_NAME'!" | ||
exit 1 | ||
fi | ||
while true; do | ||
resp="$(curl --fail --silent --show-error \ | ||
https://akurth.net/usrv/ig/shields/pipeline/akurth/axi/$BRANCH_NAME)" | ||
if [ $? -ne 0 ]; then | ||
echo "Error: Failed to obtain CI status!" | ||
exit 1 | ||
fi | ||
status="$(echo $resp | jq -r .message)" | ||
if [ "$status" == "passing" ]; then | ||
sha="$(echo $resp | jq -r .sha)" | ||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then | ||
github_sha="$(cat "$GITHUB_EVENT_PATH" | jq -r .pull_request.head.sha)" | ||
else | ||
github_sha="$GITHUB_SHA" | ||
fi | ||
if [ "$sha" == "$github_sha" ]; then | ||
echo "CI passed." | ||
exit 0 | ||
else | ||
echo "Error: CI passed, but on a different SHA: '$sha'!" | ||
exit 1 | ||
fi | ||
elif [ "$status" == "running" ]; then | ||
echo "CI is running, waiting .." | ||
else | ||
echo "Error: Unknown or failing status: '$status'!" | ||
exit 1 | ||
fi | ||
sleep 10 | ||
done | ||
shell: bash | ||
domain: iis-git.ee.ethz.ch | ||
repo: github-mirror/axi | ||
token: ${{ secrets.GITLAB_TOKEN }} | ||
poll-count: 1800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
/build | ||
/Bender.lock | ||
/Bender.local | ||
*.log | ||
*.wlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.