Skip to content

Report failing tests to the PR #89

Report failing tests to the PR

Report failing tests to the PR #89

Workflow file for this run

name: Tests
on:
push:
branches: ["main"]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: aiken-lang/[email protected]
with:
version: v1.0.20-alpha
- run: |
# Run the tests
set -o pipefail
RESULT=0
aiken check | tee aiken.log || RESULT=$?
if [ $RESULT -ne 0 ]; then
FAILING_TESTS=$(grep "FAIL" aiken.log -A 1)
echo $FAILING_TESTS
echo "FAILING_TESTS=$FAILING_TESTS" >> $GITHUB_ENV
exit $RESULT
fi
- if: failure()
run: |
echo $FAILING_TESTS
- run: aiken build
- uses: actions/github-script@v6
if: failure() && ${{ env.FAILING_TESTS }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Tests failed:\n\n\`\`\`${{ env.FAILING_TESTS }}`
})