Revert "Fix report"

This reverts commit 23be2e3d399e1b5bb299d227e79c72a8a138b345.
This commit is contained in:
danielSanchezQ 2026-04-29 10:18:53 +00:00
parent 88dffc4693
commit ee281a447d

View File

@ -40,11 +40,21 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-hack
- name: Install cargo-hack and gh
uses: taiki-e/install-action@5651179950649c44da31d346537e20c0534f0f25 # Version 2.49.35
with:
tool: cargo-hack
- name: Install gh
run: |
if ! command -v gh &> /dev/null; then
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt update && sudo apt install -y gh
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install gh
fi
fi
# Prune after Install cargo-hack, before Set up Cargo cache — frees disk space from the previous run's leftover
# artifacts (incremental compile dirs, fingerprints, build dirs) before the cache is restored. This means the
# restored cache lands onto a disk that has already been cleaned, maximizing the chance the restore succeeds
@ -74,33 +84,21 @@ jobs:
with:
command: clean
report:
name: Report failures
needs: [features]
if: failure() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
runs-on: [self-hosted, Linux]
steps:
- name: Create or update failure issue
- name: Create issue on failure
if: failure() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: |
FAILED_PLATFORMS=$(nix run 'nixpkgs#gh' -- api \
/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs \
--jq '[.jobs[] | select(.conclusion == "failure") | .name] | join(", ")')
TITLE="Cargo Hack failed on ${{ matrix.platform.label }}"
EXISTING_ISSUE=$(gh issue list --search "$TITLE" --state open --json number --jq '.[0].number')
TITLE="[CI GENERATED] Cargo Hack failed"
EXISTING_ISSUE=$(nix run 'nixpkgs#gh' -- issue list --search "$TITLE" --state open --json number --jq '.[0].number')
COMMIT_AUTHOR=$(nix run 'nixpkgs#gh' -- api \
/repos/${{ github.repository }}/commits/${{ github.sha }} \
--jq '.author.login // empty' 2>/dev/null || true)
BODY="Cargo Hack check failed for the following platforms: $FAILED_PLATFORMS
BODY="Cargo Hack check failed for platform: ${{ matrix.platform.label }}.
See details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_AUTHOR=$(gh api /repos/${{ github.repository }}/commits/${{ github.sha }} --jq '.author.login // empty' 2>/dev/null || true)
if [ -z "$EXISTING_ISSUE" ]; then
nix run 'nixpkgs#gh' -- issue create --title "$TITLE" --body "$BODY" --label "bug" --assignee "$COMMIT_AUTHOR"
gh issue create --title "$TITLE" --body "$BODY" --label "bug" --label "automated-issue" --assignee "$COMMIT_AUTHOR"
else
nix run 'nixpkgs#gh' -- issue comment "$EXISTING_ISSUE" --body "Another failure occurred: $BODY"
gh issue comment "$EXISTING_ISSUE" --body "Another failure occurred: $BODY"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}