-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 1.72 KB
/
Copy pathci.yml
File metadata and controls
85 lines (73 loc) · 1.72 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
on:
push:
branches:
- main
tags-ignore:
- '*'
paths:
- lib/**
- app/**
- config/**
- test/**
- Gemfile*
- '*.gemspec'
- .github/workflows/ci.yml
- .rspec*
- .rubocop*
- '!**/version.rb'
pull_request:
paths-ignore:
- '*.md'
- '*.txt'
- '**/version.rb'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: head
bundler-cache: true
- name: Lint code for consistent style
run: bin/rubocop -f github
test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}
strategy:
matrix:
ruby:
- 3.4
rails:
- 8.0
include:
- { ruby: head, rails: head }
env:
RAILS_VERSION: "${{ matrix.rails }}"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Set up DB
run: rake app:db:prepare
env:
RAILS_ENV: test
- name: Run specs with code coverage
uses: paambaati/codeclimate-action@v9
env:
CC_TEST_REPORTER_ID: e03ff47a923589b12eca1982eb2e6785c7b36a8fd3df63f6363016fc13a52a4c
with:
coverageCommand: bundle exec rails test
continue-on-error: ${{ matrix.allow-fail || false }}
id: test
- name: Test ${{ steps.test.outcome }}
run: |
ruby -v
bin/rails -v