Skip to content

Commit

Permalink
fixup! CI: Add cheshire CI
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Wistoff <[email protected]>
  • Loading branch information
niwis committed Feb 20, 2024
1 parent 39db32c commit ff4ef3d
Showing 1 changed file with 73 additions and 58 deletions.
131 changes: 73 additions & 58 deletions .github/workflows/cheshire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,78 @@ name: cheshire
on: [push, pull_request_target]

jobs:
trigger_cheshire_ci:
name: Trigger Cheshire CI
github-integration-ci:
runs-on: ubuntu-latest
timeout-minutes: 180
if: github.repository == 'pulp-platform/cva6'
steps:
- name: Checkout Cheshire
uses: actions/checkout@v4
with:
repository: pulp-platform/cheshire
ref: cva6/pulp-v1.0.0
token: ${{ secrets.CHESHIRE_TOKEN }}
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python requirements
shell: bash
# PIP has very noisy, uncollapsible output, making following script output hard to read
run: pip install --disable-pip-version-check --quiet --progress-bar off requests urllib3
- name: Patch Bender.lock
run: "sed -i \"/ cva6:/{n;s/.*/ revision: $GITHUB_SHA/;}\" Bender.lock"
- name: Commit ref
run: |
git checkout -b cva6-ci/$(git rev-parse --short "$GITHUB_SHA")
git add Bender.lock
git -c user.name='CVA6 CI Bot' -c user.email='[email protected]' commit -m "CVA6 regression test"
- name: Push ref
run: git push --set-upstream origin cva6-ci/$(git rev-parse --short "$GITHUB_SHA")
- name: Wait for Cheshire CI
run: |
python3 -c "
import time
import requests
poll_count = 720
poll_period = 10
api_version = '2022-11-28'
check_runs_url = f'https://api.github.com/repos/pulp-platform/cheshire/commits/cva6-ci/$(git rev-parse --short $GITHUB_SHA)/check-runs'
headers = {'Accept': 'application/vnd.github+json',
'Authorization': 'Bearer ${{ secrets.CHESHIRE_TOKEN }}',
'X-GitHub-Api-Version': api_version}
for i in range(1, poll_count+1):
pending = 0
failed = 0
response = requests.get(check_runs_url, headers=headers).json()
print(response)
for r in response['check_runs']:
if r['status'] in ('queued', 'in_progress'):
pending+=1
if r['conclusion'] == 'failure':
print(f'[{i*poll_period}s] Pipeline failure!')
exit(1)
if response['total_count'] > 0 and not pending:
print(f'[{i*poll_period}s] Pipeline success!')
exit(0)
print(f'[{i*poll_period}s] Pipeline running')
time.sleep(poll_period)
else:
print(f'[{poll_count*poll_period}s] Pipeline completion timeout!')
exit(2)"
- name: Clean up ref
run: git push origin :cva6-ci/$(git rev-parse --short $GITHUB_SHA)
- name: Run integration regression tests
uses: pulp-platform/pulp-actions/github-integration-ci@nw/github-integration-ci
with:
ip-name: cva6
org: pulp-platform
repo: cheshire
base-ref: cva6/pulp-v1.0.0
token: ${{ secrets.CHESHIRE_TOKEN }}

# jobs:
# trigger_cheshire_ci:
# name: Trigger Cheshire CI
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Cheshire
# uses: actions/checkout@v4
# with:
# repository: pulp-platform/cheshire
# ref: cva6/pulp-v1.0.0
# token: ${{ secrets.CHESHIRE_TOKEN }}
# - name: Install Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.9
# - name: Install Python requirements
# shell: bash
# # PIP has very noisy, uncollapsible output, making following script output hard to read
# run: pip install --disable-pip-version-check --quiet --progress-bar off requests urllib3
# - name: Patch Bender.lock
# run: "sed -i \"/ cva6:/{n;s/.*/ revision: $GITHUB_SHA/;}\" Bender.lock"
# - name: Commit ref
# run: |
# git checkout -b cva6-ci/$(git rev-parse --short "$GITHUB_SHA")
# git add Bender.lock
# git -c user.name='CVA6 CI Bot' -c user.email='[email protected]' commit -m "CVA6 regression test"
# - name: Push ref
# run: git push --set-upstream origin cva6-ci/$(git rev-parse --short "$GITHUB_SHA")
# - name: Wait for Cheshire CI
# run: |
# python3 -c "
# import time
# import requests
# poll_count = 720
# poll_period = 10
# api_version = '2022-11-28'
# check_runs_url = f'https://api.github.com/repos/pulp-platform/cheshire/commits/cva6-ci/$(git rev-parse --short $GITHUB_SHA)/check-runs'
# headers = {'Accept': 'application/vnd.github+json',
# 'Authorization': 'Bearer ${{ secrets.CHESHIRE_TOKEN }}',
# 'X-GitHub-Api-Version': api_version}
# for i in range(1, poll_count+1):
# pending = 0
# failed = 0
# response = requests.get(check_runs_url, headers=headers).json()
# print(response)
# for r in response['check_runs']:
# if r['status'] in ('queued', 'in_progress'):
# pending+=1
# if r['conclusion'] == 'failure':
# print(f'[{i*poll_period}s] Pipeline failure!')
# exit(1)
# if response['total_count'] > 0 and not pending:
# print(f'[{i*poll_period}s] Pipeline success!')
# exit(0)
# print(f'[{i*poll_period}s] Pipeline running')
# time.sleep(poll_period)
# else:
# print(f'[{poll_count*poll_period}s] Pipeline completion timeout!')
# exit(2)"
# - name: Clean up ref
# run: git push origin :cva6-ci/$(git rev-parse --short $GITHUB_SHA)

0 comments on commit ff4ef3d

Please sign in to comment.