-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.58 KB
/
ruby.yml
File metadata and controls
56 lines (48 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Ruby RSpec Tests
on:
schedule:
- cron: '0 6 * * *' # Run daily at 6:00 AM UTC
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
defaults:
run:
working-directory: ruby-example
jobs:
test:
name: Ruby HTML Report
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3" # Specify your Ruby version here (e.g., '3.1', '3.2', '3.3')
bundler-cache: true # Caches installed gems for faster builds
- name: Install dependencies
run: bundle install
- name: Run RSpec tests
run: bundle exec rspec --format html --out report.html
# Upload via GitHub Action (recommended)
# Skip on Dependabot PRs (no access to secrets)
- name: Upload Ruby HTML to Gaffer
if: always() && github.actor != 'dependabot[bot]'
uses: gaffer-sh/gaffer-uploader@v0.4.0
with:
gaffer_upload_token: ${{ secrets.GAFFER_UPLOAD_TOKEN }}
report_path: ruby-example/report.html
commit_sha: ${{ github.event.pull_request.head.sha || github.sha }}
branch: ${{ github.head_ref || github.ref_name }}
test_framework: rspec
test_suite: rspec
# Store artifacts for parser development
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ruby-report-${{ github.sha }}
path: ruby-example/report.html
retention-days: 30