Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: comment with rspec-stderr #2330

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push]
on: [push, pull_request, workflow_dispatch]

jobs:
rubocop:
Expand Down Expand Up @@ -220,10 +220,37 @@ jobs:
bin/rake db:create
bin/rake db:schema:load
- name: rspec
run: bin/rspec
run: bin/rspec 2> tmp/stderr
- name: tmp/rspec-stderr
run: |
test -s tmp/stderr && echo "# Rspec stderr output:" > tmp/rspec-stderr && cat tmp/stderr >> tmp/rspec-stderr
- name: Upload rspec-stderr output
uses: actions/upload-artifact@v4
with:
name: rspec-stderr
path: tmp/rspec-stderr
if-no-files-found: ignore
- name: Archive capybara artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: capybara
path: tmp/capybara/

post_to_github_pr:
runs-on: ubuntu-latest
needs: rspec
if: github.event.pull_request
permissions:
pull-requests: write
contents: read
steps:
- name: Download rspec-stderr
uses: actions/download-artifact@v4
with:
name: rspec-stderr
- name: Post to PR
uses: marocchino/sticky-pull-request-comment@v2
with:
ignore_empty: true
path: rspec-stderr