-
-
Notifications
You must be signed in to change notification settings - Fork 388
69 lines (61 loc) · 1.84 KB
/
ci.yml
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
on: [push, pull_request]
permissions:
contents: read
jobs:
specs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu, macos, windows ]
ruby: [ 3.0.6, 3.1.4, 3.2.2, 3.3.0 ]
runs-on: ${{ matrix.os }}-latest
steps:
- name: git config autocrlf
run: git config --global core.autocrlf false
if: matrix.os == 'windows'
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
- name: Clone MSpec
run: git clone https://github.com/ruby/mspec.git ../mspec
- name: Run specs (Linux)
if: matrix.os == 'ubuntu'
env:
CHECK_LEAKS: true
run: ../mspec/bin/mspec -j --timeout 30
- name: Run specs (macOS)
if: matrix.os == 'macos'
env:
CHECK_LEAKS: true
# Use a larger timeout on macOS since it seems to have less reliable performance
run: ../mspec/bin/mspec -j --timeout 90
- name: Run specs (Windows)
if: matrix.os == 'windows'
env:
CHECK_LEAKS: true
run: |
# Actions uses UTF8, causes test failures, similar to normal OS setup
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
../mspec/bin/mspec -j
- name: Run C-API specs as C++
if: matrix.os != 'windows'
env:
SPEC_CAPI_CXX: true
run: ../mspec/bin/mspec :capi
- name: Run require_relative checker
if: matrix.os == 'ubuntu'
run: ../mspec/tool/check_require_spec_helper.rb
rubocop:
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- run: gem install rubocop:1.28.2
- run: rubocop --parallel