-
-
Notifications
You must be signed in to change notification settings - Fork 5
130 lines (107 loc) · 3.15 KB
/
ci.yml
File metadata and controls
130 lines (107 loc) · 3.15 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Ruby 컴파일러 테스트
test:
name: Ruby ${{ matrix.ruby }} Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3', '3.4', 'head']
include:
- ruby: 'head'
skip_listen: true
steps:
- uses: actions/checkout@v4
- name: Setup Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: ${{ matrix.ruby != 'head' }}
# Ruby head (4.0) requires special handling due to ffi incompatibility
- name: Install dependencies (Ruby head)
if: matrix.ruby == 'head'
run: |
# Remove listen from Gemfile for Ruby 4.0+ (ffi incompatible)
sed -i '/gem "listen"/d' Gemfile
bundle install
- name: Run tests
run: bundle exec rspec --format progress --format RspecJunitFormatter --out tmp/rspec_results.xml
continue-on-error: ${{ matrix.ruby == 'head' }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-ruby-${{ matrix.ruby }}
path: tmp/rspec_results.xml
# RuboCop 린트 검사
lint:
name: RuboCop Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Run RuboCop
run: bundle exec rubocop --format github
# 테스트 커버리지
coverage:
name: Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Run tests with coverage
run: bundle exec rspec
env:
COVERAGE: true
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
# 문서 예제 검증
docs-verify:
name: Docs Verification
runs-on: ubuntu-latest
continue-on-error: true # Don't fail CI if docs have issues
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Verify documentation examples
run: bundle exec rake docs:verify
# 전체 상태 체크
ci-status:
name: CI Status
runs-on: ubuntu-latest
needs: [test, lint, coverage]
if: always()
steps:
- name: Check CI status
run: |
if [[ "${{ needs.test.result }}" == "failure" ]] || \
[[ "${{ needs.lint.result }}" == "failure" ]] || \
[[ "${{ needs.coverage.result }}" == "failure" ]]; then
echo "CI failed"
exit 1
fi
echo "CI passed"