diff --git a/.github/workflows/cheshire.yml b/.github/workflows/cheshire.yml index 7b916d3e1b..c783312a54 100644 --- a/.github/workflows/cheshire.yml +++ b/.github/workflows/cheshire.yml @@ -3,22 +3,44 @@ # SPDX-License-Identifier: Apache-2.0 name: cheshire -on: [push, pull_request] +on: [push, pull_request_target] jobs: - init: - name: init + trigger_cheshire_ci: + name: Trigger Cheshire CI runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - name: Checkout Cheshire uses: actions/checkout@v4 with: repository: pulp-platform/cheshire - path: cheshire ref: cva6/pulp-v1.0.0 - run-cheshire-ci: - name: run-cheshire-ci - needs: init-cheshire - uses: pulp-platform/cheshire/.github/workflows/lint.yml@cva6/pulp-v1.0.0 + token: ${{ secrets.CHESHIRE_TOKEN }} + - 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='cva6@bot.com' 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: | + while ! curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.CHESHIRE_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/pulp-platform/cheshire/commits/cva6-ci/$(git rev-parse --short "$GITHUB_SHA")/check-runs \ + | grep -q "\"status\": \"in_progress\""; do + echo "Waiting for Cheshire CI..." + sleep 10s + done + - name: Check Cheshire CI + run: | + ! curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.CHESHIRE_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/pulp-platform/cheshire/commits/cva6-ci/$(git rev-parse --short "$GITHUB_SHA")/check-runs \ + | grep "\"conclusion\": \"failure\""