Repository navigation
70 lines (65 loc) · 2.15 KB
/
Copy pathci-ruby.yml
File metadata and controls
70 lines (65 loc) · 2.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
name: CI - Ruby
on:
pull_request:
paths:
- 'ruby/**'
push:
branches: [main, master, develop, hotfix/*]
paths:
- 'ruby/**'
workflow_dispatch:
concurrency:
group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
name: "[smalruby3] StandardRB Lint"
runs-on: ubuntu-26.04
defaults:
run:
working-directory: ruby/smalruby3
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install SDL2 development libraries
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
- uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1.335.0
with:
ruby-version-file: ruby/smalruby3/.ruby-version
bundler-cache: true
working-directory: ruby/smalruby3
- name: Run StandardRB linter
run: bundle exec standardrb
unit-test:
name: "[smalruby3] Unit Tests (Ruby ${{ matrix.ruby }})"
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
ruby: ['3.3', '3.4', '4.0']
defaults:
run:
working-directory: ruby/smalruby3
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install SDL2 development libraries
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
# SHA 固定するとツールチェーン名を ref から読めないため明示する
with:
toolchain: stable
- uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1.335.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ruby/smalruby3
- name: Compile native extension
run: bundle exec rake compile
- name: Run unit tests
run: bundle exec rake test