This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
197 lines (164 loc) · 6.91 KB
/
test.yml
File metadata and controls
197 lines (164 loc) · 6.91 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
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
194
195
196
197
name: test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
defaults:
run:
shell: bash
jobs:
compile-and-test:
name: build and test ${{ matrix.build.target }} / ${{ matrix.build.ruby }}
runs-on: ${{ matrix.build.os }}
env:
TARGET: ${{ matrix.build.target }}
strategy:
fail-fast: false
matrix:
build:
- os: ubuntu-latest
ruby: '3.2'
target: x86_64-unknown-linux-gnu
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-unknown-linux-gnu/3.2/lib_ruby_parser.so
- os: ubuntu-latest
ruby: '3.1'
target: x86_64-unknown-linux-gnu
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-unknown-linux-gnu/3.1/lib_ruby_parser.so
- os: ubuntu-latest
ruby: '3.0'
target: x86_64-unknown-linux-gnu
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-unknown-linux-gnu/3.0/lib_ruby_parser.so
- os: macos-latest
ruby: '3.2'
target: x86_64-apple-darwin
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-apple-darwin/3.2/lib_ruby_parser.bundle
- os: macos-latest
ruby: '3.1'
target: x86_64-apple-darwin
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-apple-darwin/3.1/lib_ruby_parser.bundle
- os: macos-latest
ruby: '3.0'
target: x86_64-apple-darwin
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-apple-darwin/3.0/lib_ruby_parser.bundle
- os: macos-latest
ruby: '3.2'
target: aarch64-apple-darwin
zig: true
run-tests: false
lib-file: lib/lib-ruby-parser/native/aarch64-apple-darwin/3.2/lib_ruby_parser.bundle
- os: macos-latest
ruby: '3.1'
target: aarch64-apple-darwin
zig: true
run-tests: false
lib-file: lib/lib-ruby-parser/native/aarch64-apple-darwin/3.1/lib_ruby_parser.bundle
- os: macos-latest
ruby: '3.0'
target: aarch64-apple-darwin
zig: true
run-tests: false
lib-file: lib/lib-ruby-parser/native/aarch64-apple-darwin/3.0/lib_ruby_parser.bundle
- os: windows-latest
ruby: '3.2'
target: x86_64-pc-windows-gnu
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-pc-windows-gnu/3.2/lib_ruby_parser.so
- os: windows-latest
ruby: '3.1'
target: x86_64-pc-windows-gnu
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-pc-windows-gnu/3.1/lib_ruby_parser.so
- os: windows-latest
ruby: '3.0'
target: x86_64-pc-windows-gnu
zig: false
run-tests: true
lib-file: lib/lib-ruby-parser/native/x86_64-pc-windows-gnu/3.0/lib_ruby_parser.so
steps:
- name: checkout
uses: actions/checkout@v3
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.build.ruby }}
bundler-cache: true
- name: install zig
uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.build.zig }}
- name: compile
run: make dylib
- name: test
if: ${{ matrix.build.run-tests }}
run: make test
- name: rename dylib
run: mv ${{ matrix.build.lib-file }} ${{ matrix.build.target }}-${{ matrix.build.ruby }}.dylib
- name: upload dylib
uses: actions/upload-artifact@v2
with:
path: ${{ matrix.build.target }}-${{ matrix.build.ruby }}.dylib
name: ${{ matrix.build.target }}-${{ matrix.build.ruby }}.dylib
build-gem:
needs: ['compile-and-test']
name: build per-platform gems
runs-on: ubuntu-latest
env:
TARGET: ${{ matrix.build.target }}
strategy:
fail-fast: false
matrix:
build:
- target: x86_64-unknown-linux-gnu
- target: x86_64-apple-darwin
- target: aarch64-apple-darwin
- target: x86_64-pc-windows-gnu
steps:
- name: checkout
uses: actions/checkout@v3
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: download all dylib artifacts
uses: actions/download-artifact@v2
with:
path: '.'
- name: put all artifacts back to their directories
run: |
find .
mv x86_64-unknown-linux-gnu-3.2.dylib/x86_64-unknown-linux-gnu-3.2.dylib lib/lib-ruby-parser/native/x86_64-unknown-linux-gnu/3.2/lib_ruby_parser.so
mv x86_64-unknown-linux-gnu-3.1.dylib/x86_64-unknown-linux-gnu-3.1.dylib lib/lib-ruby-parser/native/x86_64-unknown-linux-gnu/3.1/lib_ruby_parser.so
mv x86_64-unknown-linux-gnu-3.0.dylib/x86_64-unknown-linux-gnu-3.0.dylib lib/lib-ruby-parser/native/x86_64-unknown-linux-gnu/3.0/lib_ruby_parser.so
mv x86_64-apple-darwin-3.2.dylib/x86_64-apple-darwin-3.2.dylib lib/lib-ruby-parser/native/x86_64-apple-darwin/3.2/lib_ruby_parser.bundle
mv x86_64-apple-darwin-3.1.dylib/x86_64-apple-darwin-3.1.dylib lib/lib-ruby-parser/native/x86_64-apple-darwin/3.1/lib_ruby_parser.bundle
mv x86_64-apple-darwin-3.0.dylib/x86_64-apple-darwin-3.0.dylib lib/lib-ruby-parser/native/x86_64-apple-darwin/3.0/lib_ruby_parser.bundle
mv aarch64-apple-darwin-3.2.dylib/aarch64-apple-darwin-3.2.dylib lib/lib-ruby-parser/native/aarch64-apple-darwin/3.2/lib_ruby_parser.bundle
mv aarch64-apple-darwin-3.1.dylib/aarch64-apple-darwin-3.1.dylib lib/lib-ruby-parser/native/aarch64-apple-darwin/3.1/lib_ruby_parser.bundle
mv aarch64-apple-darwin-3.0.dylib/aarch64-apple-darwin-3.0.dylib lib/lib-ruby-parser/native/aarch64-apple-darwin/3.0/lib_ruby_parser.bundle
mv x86_64-pc-windows-gnu-3.2.dylib/x86_64-pc-windows-gnu-3.2.dylib lib/lib-ruby-parser/native/x86_64-pc-windows-gnu/3.2/lib_ruby_parser.so
mv x86_64-pc-windows-gnu-3.1.dylib/x86_64-pc-windows-gnu-3.1.dylib lib/lib-ruby-parser/native/x86_64-pc-windows-gnu/3.1/lib_ruby_parser.so
mv x86_64-pc-windows-gnu-3.0.dylib/x86_64-pc-windows-gnu-3.0.dylib lib/lib-ruby-parser/native/x86_64-pc-windows-gnu/3.0/lib_ruby_parser.so
- name: run codegen
run: TARGET=x86_64-unknown-linux-gnu make do-codegen
- name: pack .gem file
run: make build-package
- name: upload .gem file
uses: actions/upload-artifact@v2
with:
path: build/lib-ruby-parser.gem
name: ${{ matrix.build.target }}-gem