-
Notifications
You must be signed in to change notification settings - Fork 28
193 lines (186 loc) · 5.71 KB
/
test.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: test
on:
push:
pull_request:
permissions:
contents: read
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby
min_version: 2.5
test:
needs: ruby-versions
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: flex --help
- run: bundle install
- run: bundle exec rspec
test-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
ruby: ['head']
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: msys2/setup-msys2@v2
id: setup-msys2
with:
update: true
install: >-
flex
- run: flex --help
- run: bundle install
- run: bundle exec rspec
test-cpp:
needs: ruby-versions
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby: ['head']
compiler: ['g++', 'clang++']
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: flex --help
- run: bundle install
- run: bundle exec rspec
env:
COMPILER: ${{ matrix.compiler }}
test-memory:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby: ['head']
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: |
sudo apt-get update -q
sudo apt-get install --no-install-recommends -q -y valgrind
- run: valgrind --version
- run: bundle install
- run: bundle exec rspec spec/lrama/integration_spec.rb
env:
ENABEL_VALGRIND: 'true'
check-misc:
runs-on: ubuntu-20.04
strategy:
matrix:
ruby: ['head']
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install
# Copy from https://github.com/ruby/ruby/blob/cb9a47f2acd6e373ef868b890a9d07da6f565dd4/.github/workflows/check_misc.yml#L31
- name: Check if C-sources are US-ASCII
run: |
grep -r -n --include='*.[chyS]' --include='*.asm' $'[^\t-~]' -- . && exit 1 || :
# Copy from https://github.com/ruby/ruby/blob/089227e94823542acfdafa68541d330eee42ffea/.github/workflows/check_misc.yml#L27
- name: Check for trailing spaces
run: |
git grep -I -n '[ ]$' -- '*.rb' '*.[chy]' '*.rs' ':!spec/' && exit 1 || :
git grep -n '^[ ][ ]*$' -- '*.md' && exit 1 || :
- name: Check for parser.rb is up to date
run: |
bundle exec rake build:parser
git diff --color --no-ext-diff --ignore-submodules --exit-code lib/lrama/parser.rb
steep-check:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby: ['head']
env:
INSTALL_STEEP: 'true'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install
- run: bundle exec rbs collection install
- run: bundle exec steep check
test-ruby:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# '3.0' is the oldest living ruby version and minimal BASERUBY version
baseruby: ['head', '3.0']
ruby_branch: ['master']
defaults:
run:
working-directory: ../ruby/build
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.baseruby }}
bundler-cache: true
- run: git clone --depth=1 https://github.com/ruby/ruby.git -b ${{ matrix.ruby_branch }} ../ruby
working-directory: .
- run: mkdir -p tool/lrama
working-directory: ../ruby
- name: Copy Lrama to ruby/tool
run: cp -r LEGAL.md NEWS.md MIT exe lib template ../ruby/tool/lrama
working-directory: .
- run: tree tool/lrama
working-directory: ../ruby
# See also https://github.com/ruby/ruby/blob/master/.github/workflows/ubuntu.yml
- run: mkdir build
working-directory: ../ruby
- name: Set ENV
run: |
echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- name: Install libraries
run: |
set -x
arch=${arch:+:${arch/i[3-6]86/i386}}
${arch:+sudo dpkg --add-architecture ${arch#:}}
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y \
${arch:+cross}build-essential${arch/:/-} \
libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \
autoconf
sudo apt-get install -q -y pkg-config${arch} || :
- run: sudo apt-get --purge remove bison
- run: ../autogen.sh
- run: ../configure -C --disable-install-doc
- run: make
- run: make test-all RUN_OPTS="$RUN_OPTS" SPECOPTS="$SPECOPTS"
env:
EXCLUDES: '../test/.excludes-parsey'
RUN_OPTS: ${{ matrix.run_opts || '--parser=parse.y' }}
SPECOPTS: ${{ matrix.specopts || '-T --parser=parse.y' }}