-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (79 loc) · 2.16 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
branches:
- '*'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build gem
run: gem build *.gemspec
- uses: actions/upload-artifact@v4
with:
name: gem
path: '*.gem'
retention-days: 1
# Check for memory leaks
memory-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true
- name: Build with ASAN
run: bundle exec rake compile
env:
NOKOLEXBOR_ASAN: '1'
- name: Run tests
run: bundle exec rake test:asan
install-gem-and-test:
needs: ['build', 'memory-check']
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
os: ['ubuntu', 'macos', 'windows']
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
# bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: gem
- name: Install gem
run: |
gem install *.gem
bundle install
- name: Run tests
run: rake test:gem # don't use bundle exec as it will load this library by default