-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci-ruby.yml
More file actions
69 lines (58 loc) · 1.71 KB
/
ci-ruby.yml
File metadata and controls
69 lines (58 loc) · 1.71 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
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI (Ruby)
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build & Test (Ruby ${{ matrix.ruby-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['3.2', '3.3']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run RuboCop linter
run: bundle exec rubocop --parallel
continue-on-error: true
- name: Run tests with RSpec
run: bundle exec rspec
continue-on-error: true
# Alternative: Run tests with Minitest
# - name: Run tests with Minitest
# run: bundle exec rake test
- name: Run tests with Rake (fallback)
run: bundle exec rake test --trace 2>/dev/null || bundle exec rake 2>/dev/null || true
continue-on-error: true
# Optional: Upload coverage to Codecov
# coverage:
# name: Coverage
# runs-on: ubuntu-latest
# needs: build
# steps:
# - uses: actions/checkout@v4
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: '3.3'
# bundler-cache: true
# - run: bundle install
# - run: bundle exec rspec --format documentation
# env:
# COVERAGE: true
# - uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: false